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

electrum

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electrum - npm Package Compare versions

Comparing version 2.7.1 to 2.8.0

lib/states.js

9

lib/index.js

@@ -8,3 +8,3 @@ 'use strict';

});
exports.LinkingMiddleware = exports.Electrum = undefined;
exports.States = exports.LinkingMiddleware = exports.Electrum = undefined;

@@ -23,2 +23,6 @@ var _radium = require('radium');

var _states = require('./states.js');
var _states2 = _interopRequireDefault(_states);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -49,2 +53,3 @@

exports.Electrum = _electrum2.default;
exports.LinkingMiddleware = _linkingMiddleware2.default;
exports.LinkingMiddleware = _linkingMiddleware2.default;
exports.States = _states2.default;
{
"name": "electrum",
"version": "2.7.1",
"version": "2.8.0",
"description": "Electrum simplifies framework-agnostic declaration of React components.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -229,1 +229,29 @@ # Electrum

means that the component should be rendered.
# States and fingerprints
Components may need to represent their internal state as a collection of simple
state objects:
```javascript
const fieldSelection = { from: 12, to: 17 }; // 'from,to'
const listSelection = { first: 5, active: 8 }; // 'active,first'
```
These state objects have _fingerprints_ which are based on their sorted
property names (`'from,to'`, `'active,first'`). It does not include the
optional `id` property.
## States class
The `States` class provides following `static` methods:
* `fingerprint (state)` → fingerprint of a state object.
* `findState (array, fingerprint)` → finds the first state which
matches the specified fingerprint.
* `replaceState (array, state)` → updates the array of states by adding
or replacing a state; matching is done based on the state's fingerprint.
* `replaceStates (array, state1, state2, ...)` → updates the array of
states based on multiple states.
* `replaceStates (array, [state1, state2, ...])` → updates the array of
states based on multiple states.

@@ -7,2 +7,3 @@ 'use strict';

import Electrum from './electrum.js';
import States from './states.js';

@@ -20,2 +21,2 @@ /******************************************************************************/

export default new Electrum (RadiumConnector);
export {Electrum, LinkingMiddleware};
export {Electrum, LinkingMiddleware, States};
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