Mock not working on store creation #2563
Answered
by
dbritto-dev
JpBurgarelli
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
dbritto-dev
May 19, 2024
Replies: 2 comments 3 replies
-
@JpBurgarelli the way you are creating the store is wrong, initializer function should be pure and shouldn't have side effects like calling an async fn inside as part of the store creation |
Beta Was this translation helpful? Give feedback.
0 replies
-
I was trying to initialize the hook by making the initial request, if that doesn't happen, Could you tell me the best way to carry out this logic?? start in the component itself? Thanks @dbritto-dev ! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@JpBurgarelli as a best practice I recommend you to use pure functions to create your store, since mocking expect pure functions too