Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global States without immutable.js ? #219

Closed
ludescher opened this issue Sep 7, 2017 · 1 comment
Closed

Global States without immutable.js ? #219

ludescher opened this issue Sep 7, 2017 · 1 comment

Comments

@ludescher
Copy link

Is there a way, to store states globally.
I know you can use immutable.js, which is described in the docs,
but i need to store data for just a few seconds, not persistent.

@ludescher ludescher changed the title Global State Global States without immutable.js ? Sep 7, 2017
@danieljharvey
Copy link
Contributor

Hi! If you are looking to store some data across your app and you are not concerned about immutability etc then perhaps try something like this configuration file:

https://github.com/futurice/pepperoni-app-kit/blob/master/src/utils/configuration.js

Replace let configuration = Map(); with let configuration = {} to use a regular JS object instead of the immutable Map, and then change the various functions to modify and share that instead. Said functions can then be imported wherever you need.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants