Excellent article and I don't wanna highjack the comment section but what do you use for product notification in React? Like if I'm building an app in React, what are some of the tools/libraries I can use to embed notifications in my app?
Am an experienced frontend developer aimed at providing user friendly and responsive web applications. I develop web pages that satisfies UI, UX experiences with optimum functionality.
You can enhance the whole process and speed, by dedicating to a web-worker to all the serialisation/deserialisation and write/read work, creating a homeMade Store (with a BehaviorSubject and a Map<> to store the data, for exemple) as a runtime cache, so you can pool the hard work (thinking at the web worker like a thread). The Web-Worker fills the cache on request, or automatically (for referenceData, like all the countries, etc ..), and you get your data from the "store", which is instant in normal conditions. Did that at work, it's working wonderfully ;) . EDIT : For security, a simple crypto algorithm is enough : localStorage is ...local, so you don't have a lot of people that will access directly to your computer/browser, and of course, you'll never persist sensitive data here : if you REALLY need to (you'll never !!), you can encrypt with an enormous key, you can use any cloud based secret-Vault to get your keys and all that. If somebody is smart enough to take the control of your working computer from an outside location, the "poorly" encrypted data that you have in your localStorage will be the least of your preoccupations :)
Not in this case. We are using local storage for a back up. If our main goal was to sync state between windows, I’d use something like the BroadcastChannel API.
We're a place where coders share, stay up-to-date and grow their careers.
just did same thing here
Definitely need to include security in the considerations, as private data should never persist to local storage.
Good point, thanks I'll add it in.
🙌 nice work
Excellent article and I don't wanna highjack the comment section but what do you use for product notification in React? Like if I'm building an app in React, what are some of the tools/libraries I can use to embed notifications in my app?
Why not writing simple react code without adding typescript? Not everyone understands typescript.
Because type safety is important even with simple implementations.
they should ;)
You can enhance the whole process and speed, by dedicating to a web-worker to all the serialisation/deserialisation and write/read work, creating a homeMade Store (with a BehaviorSubject and a Map<> to store the data, for exemple) as a runtime cache, so you can pool the hard work (thinking at the web worker like a thread). The Web-Worker fills the cache on request, or automatically (for referenceData, like all the countries, etc ..), and you get your data from the "store", which is instant in normal conditions. Did that at work, it's working wonderfully ;) . EDIT : For security, a simple crypto algorithm is enough : localStorage is ...local, so you don't have a lot of people that will access directly to your computer/browser, and of course, you'll never persist sensitive data here : if you REALLY need to (you'll never !!), you can encrypt with an enormous key, you can use any cloud based secret-Vault to get your keys and all that. If somebody is smart enough to take the control of your working computer from an outside location, the "poorly" encrypted data that you have in your localStorage will be the least of your preoccupations :)
You might need to listen "storage" event and update component state accordingly, as we can always change local storage directly.
Not in this case. We are using local storage for a back up. If our main goal was to sync state between windows, I’d use something like the BroadcastChannel API.