npm.io
1.1.1 • Published 5 years ago

@iadvize-oss/store-devtools

Licence
MIT
Version
1.1.1
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
2

@iadvize/store-devtools

Devtools for @iadvize/store, a lightweight Javascript store library.

Use @iadvize/store-devtools to debug your store with ReduxDevtools extension.

Documentation

Usage

npm install @iadvize-oss/store @iadvize-oss/store-devtools

@iadvize-oss/store is a peer-dependency

Example

import * as Store from '@iadvize/store';
import { withDevtools } from '@iadvize/store-devtools';

const store = withDevtools({
  name: 'my store',
})(Store.create(() => 2)());

Instead of classic Redux action type, it will try to use the reducer function name to log the change.

store.apply(
  function multiplyByTwo(state: number) {
    return state * 2;
  }
)();

Devtools will use multiplyByTwo as change type here.

Keywords