unstated-enhancers
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Unstated tools and enhancers

Install

npm install --save unstated-enhancers
 
# or 
 
yarn install --save unstated-enhancers

Manager

Global containers manager registration

import { Manager } from 'unstated-enhancers';
 
Manager.run();

To register your containers into the manager you must provide a name key inside the container class definition.

 
type CounterState = {
  count: number
};
 
class CounterContainer extends PersistContainer<CounterState> {
  name = 'counter'
 // ...
}

Then in other places simple call your containers using the container name property registered previously

import { Manager } from 'unstated-enhancers';
 
// ...
    Manager.get('counter').increment();
// ...

Logger

Redux like logger with redux dev tools integration

Docs

connect

Connect containers to components easily

Heavily inspired by unstated-connect

Docs

Combine containers

Combine multiple containers into one and make them communicate with each other.

Base code from unstated-compose but with no child and parent class inheritance.

Docs

Persist

Adds persistence to your unstated containers

Heavily inspired by unstated-persist

Docs

Package Sidebar

Install

npm i unstated-enhancers

Weekly Downloads

11

Version

2.0.0

License

MIT

Unpacked Size

785 kB

Total Files

61

Last publish

Collaborators

  • xaamin