Skip to content

Releases: ilyalesik/effector-localstorage

v1.0.0

14 Jul 14:57
5079fbd
Compare
Choose a tag to compare

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

03 Dec 07:20
Compare
Choose a tag to compare

Store synchronization has been separated into the sync module:

import {createStore, createEvent} from 'effector'
import connectLocalStorage from "effector-localstorage/sync";

New feature: onChange method

14 Nov 19:40
Compare
Choose a tag to compare

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

13 Nov 09:55
Compare
Choose a tag to compare

New feature:

init gets default value:

counterLocalStorage.init(0)

Fix error handling

In case of error onError was called, instead of errorHandler

Decreasing size

120B -> 111B

Add TS typings

06 Aug 06:18
Compare
Choose a tag to compare
v0.2.0

v0.2.0