Skip to content

Namespaces, Serialization, Expiration and more!

Latest
Compare
Choose a tag to compare
@fedekau fedekau released this 13 Jan 01:23
· 644 commits to master since this release

This version has been re-written from scratch in order to allow possible contributors to more easily add new storage options. With this refactor adding new options is as easy as adding a file (and of course testing it), all contributions are welcome!

New Features 🍾 🎉 :

  • ExpirableStorage adds the ability to expire preferences see #71
  • NamespaceableStorage it allows your preferences to be namespaced
  • SerializableStorage it allows you to provide custom serializer/deserializer functions to handle you you preferences in custom ways, the default is JSON, but you can provide CSV, binary, etc.
  • All options can be provided globally or locally

Breaking Changes💥:

  • Previously all preferences would use the vp namespace, so if you want to be able to use already saved preferences you will need to add namespace: 'vp' to you options
  • If you provide some kind of custom storage you now need to ensure a removeItem method is available.

Bug Fixes 🐛:

  • The preferences in the programatic way didn't worked properly, now they do!