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.
alt-localstore
Advanced tools
save and restore alt store state to localStorage, listens to changes
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 is written in es6 and is transpiled to es5 on npm publish. Default import retrieves the babel transpiled es5 version. The es6 source code can be found in src/index.js
.
FAQs
save and restore alt store state to localStorage, listens to changes
The npm package alt-localstore receives a total of 0 weekly downloads. As such, alt-localstore popularity was classified as not popular.
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
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.