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.8.2 to 2.9.1

src/test/field-states.js

12

lib/index.js

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

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

@@ -15,2 +15,4 @@ var _radium = require('radium');

var _electrumField = require('electrum-field');
var _linkingMiddleware = require('./linking-middleware.js');

@@ -24,6 +26,2 @@

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

@@ -54,3 +52,5 @@

exports.Electrum = _electrum2.default;
exports.FieldStates = _electrumField.FieldStates;
exports.LinkingMiddleware = _linkingMiddleware2.default;
exports.States = _states2.default;
/******************************************************************************/
{
"name": "electrum",
"version": "2.8.2",
"version": "2.9.1",
"description": "Electrum simplifies framework-agnostic declaration of React components.",

@@ -32,10 +32,10 @@ "main": "lib/index.js",

"electrum-events": "^1.1.2",
"electrum-field": "^1.0.1",
"electrum-store": "^1.2.0",
"electrum-theme": "^1.4.0",
"electrum-utils": "^1.0.0"
"electrum-field": "^1.2.2",
"electrum-store": "^1.4.0",
"electrum-theme": "^1.5.0",
"electrum-utils": "^1.1.0"
},
"devDependencies": {
"babel-cli": "^6.4.0",
"babel-core": "^6.4.0",
"babel-cli": "^6.4.5",
"babel-core": "^6.4.5",
"babel-plugin-transform-decorators": "^6.4.0",

@@ -53,3 +53,3 @@ "babel-plugin-transform-react-display-name": "^6.4.0",

"path": "^0.12.7",
"radium": "^0.16.2",
"radium": "^0.16.4",
"react": "^0.14.6",

@@ -56,0 +56,0 @@ "react-addons-shallow-compare": "^0.14.6",

@@ -244,14 +244,27 @@ # Electrum

## States class
## FieldStates class
The `States` class provides following `static` methods:
The `FieldStates` class maintains an internal array of state objects.
It is implemented in `electrum-field` and made available by `electrum`
as a convenience.
* `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.
### Query the field states
* `FieldStates.fingerprint (state)` → the fingerprint of a state object.
* `find (fingerprint)` → the first state object which matches the
specified fingerprint, or `undefined` if none can be found.
* `get ()` → an immutable array of immutable state objects.
### Update the field states
The instances are immutable. All methods which modify the internal array
of state objects will return a new instance (or the unchanged instance if
the update was a no-op). The original instance is never modified.
* `add (state)` → a new instance where the internal array of states has
been updated by adding or replacing a state; matching is done based on the
state's fingerprint.
* `add (state1, state2, ...)` → same as `add()` called multiple times.
* `remove (fingerprint)` → a new instance where the internal array of
states has been updated by removing the first state matching the specified
fingerprint.
'use strict';
import radium from 'radium';
import {FieldStates} from 'electrum-field';
import LinkingMiddleware from './linking-middleware.js';
import Electrum from './electrum.js';
import States from './states.js';

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

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