Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.