
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
react-vault
Advanced tools
ReactVault is backed by localStorage, keeps and shares states between components and is meant to used with pure React
ReactVault will keep and share state between components. It is backed by
window.localStorage
and is meant to be used with pure React.
To start using ReactVault first import it in your components
import Vault from 'react-vault';
And initialize it with the method load
in the component constructor
constructor(props){
super(props);
Vault.load(this); //you should pass the context of the component
}
ReactVault may co-exist with component states and optionally receives an initial
state as the second parameter of the load
method;
constructor(props){
super(props);
this.state = {
foo: 'Some value'
};
Vault.load(this,{name: 'John Doe'}); //second parameter is optional
}
The precedence of states are in order of importance:
**ReactVault State** > **Local State** > **Global State**
Be careful to pick unique names and handle state keys as more specific states will always overwrite more generic states.
Now use ReactVault to set, get, check and clear state data. They will be kept and shared by all components in your application.
Vault.set('name','Firstname Lastname');
Vault.set('age','30');
Vault.get('name'); //returns Firstname Lastname
Vault.has('name'); //returns true
Vault.clear('name'); //Removes the 'name' key
Vault.clear(); //Clear all data in ReactVault and in all component states
FAQs
ReactVault is backed by localStorage, keeps and shares states between components and is meant to used with pure React
We found that react-vault 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
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.