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

Mock Preferences #1041

Open
josh-griffin opened this issue Mar 14, 2022 · 1 comment
Open

Mock Preferences #1041

josh-griffin opened this issue Mar 14, 2022 · 1 comment
Labels

Comments

@josh-griffin
Copy link
Contributor

An idea! Woah!

  • Create a context Preferences which has an initial value of preferences read from local storage.
  • On mounting, send a 'request' (in the meantime this is what is mocked - just a fn which returns a promise for a hardcoded object) which also stores to local storage
  • Have a usePreference(prefKey) (just a string or hard coded enums for type safety 🤔 )
@josh-griffin
Copy link
Contributor Author

I think a difficulty would be wanting to use these prefs in a lot of the common library code.

So I think a decision whether that is a good or bad idea should be made from the start

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

No branches or pull requests

1 participant