Atyantik/react-pwa

set global varibal for internal API

lamvananh opened this issue · 3 comments

Hi, How can i declare global variable in src/api/index.js ?
I has declare my variable as "var myItem = []" at the top of file. But every time a route triggerd, it's value always be reseted to initial ([] in this case)

@lamvananh you cannot do it like that. Please consider using Redux instead.

Hi, could you show me how to dispatch and consume a redux action in this project ?. I don't find this in the document, it's talking about the config step only