Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
buildo-react-pure
Advanced tools
Light decorator that adds "shouldComponentUpdate" to pure react components to improve performance
@pure
is a light decorator that adds shouldComponentUpdate
to pure react components to improve performance.
npm i --save buildo-react-pure
@pure
decorator can only be applied to React.Component(s) classes.
@pure
export default class MyComponent extends React.Component {
render() {
return <div />
}
}
@pure
adds the logic to the method shouldComponentUpdate
to perform a shallow compare between current and previous props/state. If nor the props nor the state refs have changed, shouldComponentUpdate
will return false
and React will automatically use the result cached from previous render: you avoid a useless re-render!
@pure
export default class MyComponent extends React.Component {
static propTypes = {
input1: React.PropTypes.number.isRequired,
input2: React.PropTypes.number.isRequired
}
render() {
const { input1, input2 } = this.props;
// some heavy computation
const computedResult = heavyComputation(input1, input2);
return (
<div>
{computedResult}
</div>
);
}
}
In the example above if something triggers a re-render but input1
and input2
have still the same ref they had in the previous render the unnecessary heavyComputation
will be completely avoid.
FAQs
Light decorator that adds "shouldComponentUpdate" to pure react components to improve performance
The npm package buildo-react-pure receives a total of 0 weekly downloads. As such, buildo-react-pure popularity was classified as not popular.
We found that buildo-react-pure 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.