-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat(injectLocalStorage): initial implementation of injectLocalStorage #295
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 511db52. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targetsSent with 💌 from NxCloud. |
Should this utility function also, follow the "inject***" naming pattern like other functions? @eneajaho |
I've got no strong opinion on the naming of this, I can fix it if you want it to change :) I also have some stuff I want to clean up, like passing the validate func as a part of an optional "options" param, as there might be other stuff to add, and it fits the "signal" way of passing optional options. |
Hello @palexcast Wanted to link this other implementation here https://twitter.com/_wallstreetdev/status/1767693809503084873 Would like to start a conversation about these implementations and find the best way to go forward. |
Hello WSD here :)
|
I'll take a look at both those implementations and see if I can adjust some of my implementation with some input from those. If there is any more input/wishes regarding the direction of the implementation that would be greatly appreciated :) |
@guzmanoj So I finally had some time, and the more I look at your implementation I really like it. It's clean and functional. For now I copy-pasted your solution, and renamed it to In regards to error handling, I'm not sure about what the "signal" convention is regarding this. My current thought regarding this, is that the I also unwrapped the serializer so you don't need to pass both I've also adjusted the tests, but want to add some more, would be nice to get some feedback before moving on though. |
libs/ngxtension/inject-local-storage/src/inject-local-storage.ts
Outdated
Show resolved
Hide resolved
Can you also update the PR description, so it is the same as the updated code we have? |
@eneajaho Updated the PR in regards to your comments :D |
Adds a utility that synchronizes localStorage changes across tabs.
…m implementations
98190fc
to
9657ec1
Compare
Thanks for this @palexcast 🙌 |
Thanks for the reviews and help getting this merged @eneajaho :D |
Solves #245
Adds a utility that synchronizes localStorage changes across tabs, and has an optional validate method to verify the validity of the object.
I can create a PR for a similar/same thing for sessionStorage if this seems like a good idea/implementation.
Would love some feedback before I do that though :)
Usage: