
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
alt-localstore
Advanced tools
This is a module for automatically saving and restoring store state from localStorage
for react applications using alt
and immutable
.
First, make sure you make the setState()
method public in the state constructor like so:
class MyStore {
constructor() {
this.exportPublicMethods({
setState: this.setState
});
}
}
Without this, the localstore won't be able to restore the store state from localStorage
.
import LocalStore from 'alt-localstore';
import MyStore from './MyStore';
let myStore = alt.createStore(MyStore);
let localCache = new LocalStore(myStore);
localCache.restore();
Constructor takes in an alt store instance and an optional key to be used for localStorage
which defaults to the store displayName
.
Save the store state to localStorage
. Automatically called on store state changes.
Takes in optional state param to save instead of the store state.
Restore the localStorage
saved data to the state store. Defaults to {}
.
Listen to store state changes and automatically persist the new state to localStorage
.
Automatically called in the constructor.
Stop listening to store state changes.
Source code was originally written in es6. Default import retrieves the babel transpiled es5 version. To import the es6 version of the module, use import LocalStore from 'alt-localstore/index.es6'
FAQs
save and restore alt store state to localStorage, listens to changes
We found that alt-localstore 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.