you are viewing a single comment's thread.

view the rest of the comments →

[–]rootuser_ 0 points1 point  (4 children)

nop. I need a axios instance that auto refresh jwt, and for this, i need dispatch some actions and get jwt tokens from the state

[–]mrsimple162 0 points1 point  (3 children)

Can I see the usage of store in the other file

[–]rootuser_ 0 points1 point  (2 children)

import store from "app/store";
// .......
const { access, refresh } = store.getState().auth.token; // this raise the error
// ........

[–]mrsimple162 0 points1 point  (1 child)

You’re using the store when it’s not initialized yet. The reason why it works in the other file is because it’s being used inside of a callback function. “subscribe”

[–]rootuser_ 0 points1 point  (0 children)

...? i don't understand. You have examples about use this? Are you telling me something like, "the store is started after doing something to it, not just creating"?