Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-state

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-state - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

lib/logger.js

8

lib/index.js

@@ -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;

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc