Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
react-fantasy
Advanced tools
Rendering fantasyland
structures in React.
Option is a container for value, witch encapsulate null check condition. Allow replace null
with Option.None
and write only logic without any checks.
Usage
var React = require('react'),
Option = require('fantasy-options').Option,
option = require('react-fantasy').option;
var SomeValue = React.createClass({
getDefaultProps : function () {
return {
value : Option.None;
}
},
renderValue : function (value) {
return (
<span className="value">
{value}
</span>
)
}
render : function () {
return option(this.renderValue).render(this.props.value);
}
});
var SomeContainer = React.createClass({
getDefaultProps : function () {
return {
value : Option.of('Some string');
}
},
render : function () {
return (
<div>
<SomeValue />
<SomeValue value={this.props.value} />
</div>
)
}
})
Rendered as
<div>
<noscript/>
<span class="value">
Some string
</span>
</div>
Add check propTypes and contextTypes for fantasy structures such as Option, Seq and Json. In future will be added Either, Readers, Writers and State
PropTypes example:
var fpt = require('react-fantasy').PropTypes;
var SomeClass = React.createClass({
...
propTypes : {
page: fpt.option.isRequired,
items: fpt.seq.isRequired,
config: fpt.json.isRequired
}
...
});
Whenever non required values is possible, but that non functional behavior, because before rendering need some checks for ensure what value is present.
MIT
FAQs
Renderers for stuctures from fantasyland project
The npm package react-fantasy receives a total of 0 weekly downloads. As such, react-fantasy popularity was classified as not popular.
We found that react-fantasy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.