Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mobx-state-tree-localstorage
Advanced tools
[![npm version](https://badge.fury.io/js/mobx-state-tree-localstorage.svg)](https://badge.fury.io/js/mobx-state-tree-localstorage) [![CircleCI](https://circleci.com/gh/isaachinman/mobx-state-tree-localstorage.svg?style=shield)](https://circleci.com/gh/isa
Persist your mobx-state-tree
stores in localStorage
mobx-state-tree-localstorage
is a helper package, which allows you to easily persist your mob-state-tree
stores in localStorage.
yarn add mobx-state-tree-localstorage
You need to also have mobx
and mobx-state-tree
installed.
Instead of calling model.create()
, pass it into the persistInLocalStorage
function, which will persist the tree in localStorage, and also return the created model:
// Change this
const store = Store.create({
todos: [
{
title: "Get coffee"
}
]
})
// To this
const store = persistInLocalStorage({
tree: Store,
id: '@myapp/TodoStore',
initialState: {
todos: [
{
title: "Get coffee"
}
]
}
})
Key | Explanation |
---|---|
tree | A mobx-state-tree model |
id | A string ID which will be used to get/set the tree in localStorage |
initialState | The initial state for your store |
blacklistKeys | Any top-level keys for your store which you don't want to persist in localStorage |
FAQs
[![npm version](https://badge.fury.io/js/mobx-state-tree-localstorage.svg)](https://badge.fury.io/js/mobx-state-tree-localstorage) [![CircleCI](https://circleci.com/gh/isaachinman/mobx-state-tree-localstorage.svg?style=shield)](https://circleci.com/gh/isa
We found that mobx-state-tree-localstorage 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.