Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Electrum simplifies framework-agnostic declaration of React components and is used internally by Epsitec SA to bridge the gap with its Xcraft toolchain and with its Lydia framework.
To include and configure Electrum in a JavaScript project, simply
npm install electrum
. Then:
var Electrum = require ('electrum');
var Radium = /* ...provide a reference to the Radium library... */
var Lydia = /* ...provide a reference to the Lydia.js library... */
var E = new Electrum (Radium, Lydia);
var Component = E.createClass ({...});
// or
var E = new Electrum ();
E.use (Radium);
E.use (Lydia);
var Component = E.createClass ({...});
// or
var Component = new Electrum ()
.use (Radium)
.use (Lydia)
.createClass ({...});
Create React components with E.createClass({...})
instead of
React.createClass({...})
. Electrum takes care of extending the
provided object, for instance to include a call to Radium.wrap()
,
etc.
When several wrappers are applied (as in the example above), then they will be applied right to left:
var E = new Electrum (Radium, Lydia);
var C = E.createClass ({});
is thus equivalent to:
var C = React.createClass (Radium.wrap (Lydia.wrap ({})));
The wrappers must conform to the following interface:
var Wrapper = {
wrap: obj => obj, // mandatory: wrap function
getElectrumApi: () => {/*API*/} // optional: get Electrum API implementation
getElectrumBus: () => {/*Bus*/} // optional: get Electrum Bus implementation
};
Electrum provides access to external services which are useful when implementing React components:
At least one wrapper should provide an implementation of the Electrum API and one should provide an implementation of the Electrum Bus.
Interface for the Electrum API
getState: function (obj, what) {},
setState: function (obj, ...states) {},
getStyle: function (obj) {},
getText: function (obj) {},
getValue: function (obj) {},
setValue: function (obj, value, ...states) {}
Interface for the Electrum bus
dispatch: function (obj, message) {},
notify: function (obj, value, ...states) {}
createClass
?This is not yet implemented in version 0.0.x
Electrum provides an entry point to the style objects used in conjunction with Radium. Themes are broken down into distinct axes:
These collection of partial styles and constants can be accessed through the palette
,
typo
, shape
and animation
Electrum properties.
Example (don't take it too seriously, though):
var boxStyles = [
E.palette.colors.box.background,
E.typo.title,
{
height: E.shape.defaultBarHeight,
opacity: 0.8,
':hover': {
height: E.shape.defaultBarHeight * 1.2,
opacity: 1.0,
transition: { height: E.animation.open, opacity: E.animation.pop }
}
}
];
Electrum is an alloy of gold and silver used to produce ancient Lydian coinage.
The first metal coins ever made, were of Electrum and date back to the end of the 7th century, beginning of the 6th century BC.
FAQs
Electrum simplifies framework-agnostic declaration of React components.
The npm package electrum receives a total of 11 weekly downloads. As such, electrum popularity was classified as not popular.
We found that electrum demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.