set global varibal for internal API
lamvananh opened this issue · 3 comments
lamvananh commented
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)
tirthbodawala commented
@lamvananh you cannot do it like that. Please consider using Redux instead.
lamvananh commented
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
patelmayankce commented
@lamvananh , you can checkout https://github.com/Atyantik/example-pawjs-redux