ngrx / platform

Reactive State for Angular
https://ngrx.io
Other
7.96k stars 1.95k forks source link

@ngrx/signals: Add `storage` sub-package #3997

Open markostanimirovic opened 11 months ago

markostanimirovic commented 11 months ago

Information

Add the @ngrx/signals/storage sub-package that will contain the withStorageSync feature.

The initial implementation is available here: https://github.com/markostanimirovic/ngrx-signal-store-playground/blob/main/src/app/shared/storage-sync.feature.ts

I would be willing to submit a PR to fix this issue

bohoffi commented 7 months ago

Hi @markostanimirovic I'm willing to support the ngrx team by submitting a PR for the storage feature. It'd be a perfect replacement for a meta reducer I'm using right now with the good old store. I've build a working poc in two variants - as a custom feature implemented in my own app and as a sub-package in a ngrx/platform fork. Event though I got it working I had to use some deep imports from the ngrx/signals main entrypoint which isn't very satisfying.

Would you mind sharing some of your thoughts about the packages features?

ducin commented 5 months ago

@markostanimirovic would be happy to help here, if help is needed.

gabrielguerrero commented 2 months ago

@markostanimirovic I also created an implementation for @ngrx-traits/signals, here https://github.com/gabrielguerrero/ngrx-traits/blob/main/libs/ngrx-traits/signals/src/lib/with-sync-to-web-storage/with-sync-to-web-storage.ts in case anything will be useful, Im happy to help with this too. I also I did lots of other custom storage features , like withCalls that I think could be useful if they were subpackages that I will be happy to colaborate