Skip to content

Typescript issue with Vanilla/Bound store while testing #1564

Answered by dai-shi
holgergp asked this question in Q&A
Discussion options

You must be logged in to vote

You don't need to use UseBoundStore type. It's for something else.

Just typing your function should work, like this:

export const useBoundStore = <T>(
  selector: (state: FooState) => T,
  equals?: (a: T, b: T) => boolean
) => useStore(fooStore, selector, equals);

@sewera @chrisk-7777 @dbritto-dev This would be a good one for docs if we don't have it yet.

Replies: 6 comments 26 replies

Comment options

You must be logged in to vote
6 replies
@holgergp
Comment options

@chrisk-7777
Comment options

@holgergp
Comment options

@churichard
Comment options

@dai-shi
Comment options

Answer selected by holgergp
Comment options

You must be logged in to vote
15 replies
@holgergp
Comment options

@dai-shi
Comment options

@holgergp
Comment options

@chrisk-7777
Comment options

@holgergp
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@dannobytes
Comment options

@sewera
Comment options

sewera Apr 27, 2023
Collaborator

@dannobytes
Comment options

@dannobytes
Comment options

Comment options

You must be logged in to vote
1 reply
@dannobytes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants