Releases: ilyalesik/effector-localstorage
v1.0.0
This is completely full rewrite of the package.
Original sources was made 4 years back, and become obsolete with time (though original code is still working as intended, thanks for simplicity and effector's back compatibility).
Instead of two modules (main
and sync
) there is a single module now, which supports synchronization as well. It is slightly bigger (few bytes) than original main
module from previous version, and less, than original sync
module from previous version. Original sources are kept in old
directory for reference (because different versions of size-limit shows different sizes for same code).
Main reason for rewrite — is to change API.
Two different packages for localStorage
(effector-localstorage
and effector-storage
) confuses users, sometimes someone asks in effector's community chat, which one should they use. Well, both packages are good, but effector-localstorage
is tiny and with bare-minimum functionality, while effector-storage
is slightly bigger (around 1.5 kb for localStorage
adapter), but with richer functionality.
And we decided to change effector-localstorage
API so it become similar to effector-storage
. So, you can use tiny package as long as it fits your requirements, and simply change import to start using rich functionality.
I love tiny packages, so I would not like to mark effector-localstorage
as deprecated and obsolete.
So, meet second life of effector-localstorage
with new API :)
v0.5.0
New feature: onChange method
New onChange
method allow to subscribe on storage change event:
const setCounter = createEvent('set counter')
const counterLocalStorage = connectLocalStorage("counter")
.onChange(setCounter) // call event on external storage change
v0.3.1
Add TS typings
v0.2.0 v0.2.0