1.1.1 • Published 7 years ago

immutable-console v1.1.1

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

Logger for Immutable.js

build status npm version license: MIT

Debugging utility for human readable printing of Immutable.js data structures.

Installation

Using npm

npm i immutable-console -D

Using yarn

yarn add immutable-console -D

Usage

Logger utility can be used as-is to show Immutable.js data structures in human readable format or with redux-logger middleware for Redux.

AS-IS example

import { List, Map } from 'immutable';
import immutableConsole from 'immutable-console';

const user = Map({
  id: '42',
  name: 'John Doe'
});

immutableConsole.log(user); // {id: '42', name: 'John Doe'}
console.log(user); // {size: 2, __altered: false, __hash: undefined, __ownerID: undefined, _root: {ownerID: f, entries: Array(2)}, length: 2}

redux-logger example

import { applyMiddleware, createStore } from 'redux';
import { createLogger } from 'redux-logger';
import immutableConsole from 'immutable-console';

const logger = createLogger({
  logger: immutableConsole
});

const store = createStore(
  reducer,
  applyMiddleware(logger)
);

License

MIT

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago