hookstore-logger
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

hookstore-logger

NPM version Build Status Coverage Status NPM downloads

redux-logger style middeware for hookstore

hookstore-logger

Install

$ npm install hookstore-logger -D
# or 
$ yarn add hookstore-logger

Usage

import { Provider, applyMiddlewares } from 'hookstore';
import logger from 'hookstore-logger';
 
const model = {
  name: 'foo',
  state: {},
  actions: {},
};
 
function App() {
  // App component code
}
 
function Root = () => {
  const middlewares = [
    logger({ showDiff: true, showTook: true }),
    // add other middlewares
  ];
 
  applyMiddlewares(middlewares);
 
  return <Provider model={model}><App /></Provider>;
}
 
ReactDOM.render(<Root />, document.querySelector('app'));

Injoy it!

Package Sidebar

Install

npm i hookstore-logger

Weekly Downloads

1

Version

0.2.2

License

MIT

Unpacked Size

18 kB

Total Files

11

Last publish

Collaborators

  • dmyang