easy-state
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
exports.logger = undefined; | ||
@@ -12,4 +13,9 @@ var _createStateTree = require('./createStateTree'); | ||
var _logger = require('./logger'); | ||
var _logger2 = _interopRequireDefault(_logger); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = _createStateTree2.default; | ||
exports.default = _createStateTree2.default; | ||
exports.logger = _logger2.default; |
{ | ||
"name": "easy-state", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Simple state manipulation without any frameworks.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -1,2 +0,2 @@ | ||
# EasyState | ||
# Easy-state | ||
Simple state manipulation without any frameworks. | ||
@@ -34,6 +34,3 @@ <br><br> | ||
> For larger applications you can divide your stores into | ||
> smaller pieces, to get more control over certain parts. | ||
Counter-example: | ||
## Counter-example: | ||
```js | ||
@@ -69,2 +66,25 @@ const store = createStateTree({ counter: 0 }); | ||
> For larger applications you can divide your stores into | ||
> smaller pieces, to get more control over certain parts. | ||
## Logger | ||
Easy-state also provides a logger to make the developer experience better. | ||
It takes the advantage of the subscribe method provided from `createStateTree` to log `prev` and `next` state to the console on every state change. | ||
![easy state logger](./demo/logger_easy_state.png) | ||
> NB: You should remove the logger before shipping to production. | ||
Here's how to use it: | ||
```js | ||
import createStateTree, { logger } from 'easy-state'; | ||
const store = createStateTree({ counter: 1 }); | ||
/** | ||
* Pass the store to the logger | ||
**/ | ||
logger(store) | ||
``` | ||
### Developing easy-state | ||
@@ -71,0 +91,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148142
10
152
131