0.8.1 • Published 2 months ago

@tinyslice/hydration-plugin v0.8.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Hydration Plugin

This plugin injects state when registered and persists it as long as it's running.

Since plugins can be attached to any slice if you only want to persist some slices, just add the plugin at those slices and not to the root one. Just make sure they don't write to the same localStorage key.

Migrations

Migrations can be defined on the plugin, if one finds and entry based on the migrations fromKey, it will run the migration function, save the result to toKey and remove fromKey. All remove, getter and setter functions can be overriden for each separate migration to allow migrating from and to different storages.

Only successful migrations delete the original entry and migrations are ran behind a try/catch block. So if you change your cache-key to invalidate the users state but you forgot a migration, you can retrieve it later.

When a migration finds something already at the target key it passes it to your migrate function, allowing for merging.

0.8.1

2 months ago

0.8.0

10 months ago

0.7.0

2 years ago

0.6.6

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.7

2 years ago