2.0.5 • Published 3 years ago

@romanzy/simply-store v2.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@romanzy/simply-store

A simple store library inspired by Mobx. It is less performant then Mobx as it does not use observables, yes it is smaller and simpler to work with. Supports any browser as it does not use Proxies

This package has the following features:

  • No boilerplate, single class store definitions
  • Easy to define actions
  • Cache values (same as @computed Mobx decorator)
  • Easy to work with async (with @asyncAction and @asyncCache decorators)
  • In depth detailed logging on chosen mutations
  • Easy to use/write middleware (broken at the moment)
  • Simple observable for primitive types
  • LitElement integration mixin

Getting started

Install the package on npm:

npm i @romanzy/simply-store

OR clone this repository and install its dependencies:

git clone https://github.com/romanzy-1612/simply-store
cd simply-store
npm install

Run a demo with live server:

npm run demo

A quick example (WIP)

Define a store:

WIP;

Define a webcomponent:

WIP;

Check out demo folder for examples (WIP)

Decorator guide

WIP

Middleware guide

WIP

TODO

  • change cache to a function, allow to pass params which are cached
  • @asyncCache(invalidateOnStoreChange: () => this.var, this.var2) | true) when evaluation of sotre vars changes, the async is run again
  • enable logging for async functions (wait till resolution, detect value changes (with a hash attached on the update), provide relative timestamps)
  • implement testing
  • improve readme to describe all decorators, guide to middleware creation
  • add more demo examples
  • add more middlewares
  • check that transpiled builds work on ie11
  • enable logging change detection and possible time travel
2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago