Gathering detailed insights and metrics for mobx-persist-sync
Gathering detailed insights and metrics for mobx-persist-sync
Gathering detailed insights and metrics for mobx-persist-sync
Gathering detailed insights and metrics for mobx-persist-sync
npm install mobx-persist-sync
Typescript
Module System
Node Version
NPM Version
TypeScript (61.89%)
JavaScript (36.8%)
HTML (1.31%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
560 Stars
109 Commits
62 Forks
10 Watchers
2 Branches
7 Contributors
Updated on Jun 14, 2025
Latest Version
0.4.4
Package Id
mobx-persist-sync@0.4.4
Unpacked Size
13.41 kB
Size
4.74 kB
File Count
13
NPM Version
6.14.18
Node Version
14.21.3
Published on
Nov 04, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
$ npm install mobx-persist-sync --save
1import { observable } from 'mobx' 2import { create, persist } from 'mobx-persist' 3 4class SomeItem { 5 @persist @observable name = 'some' 6 @persist @observable count = 0 7} 8 9class SomeStore { 10 @persist('object') @observable obj = { a: 1, b: 2 } 11 @persist('map') @observable stringMap = observable.map<string>({}) 12 @persist('list') @observable numList = [1,2,3,4] 13 @persist('object', SomeItem) @observable s = new SomeItem 14 @persist('map', SomeItem) @observable m = observable.map<SomeItem>({}) 15 @persist('list', SomeItem) @observable l = [] 16} 17 18const hydrate = create({ 19 storage: localForage, // or MMKV in react-native. 20 // default: localStorage 21 jsonify: false // if you use MMKV, here shoud be true 22 // default: true 23}) 24 25// create the state 26export const someStore = new SomeStore() 27hydrate('some', someStore); 28console.log('someStore has been hydrated') 29
without decorators
1const data = observable({ 2 title: 'no decorator', 3 someObject: { 4 a: 1, 5 b: 'b', 6 }, 7 someArray: [{ 8 c: 1, 9 d: 'd' 10 }] 11}) 12const schema = { 13 title: true, 14 someObject: { 15 type: 'object', 16 schema: { 17 a: true, 18 b: true 19 } 20 }, 21 someArray: { 22 type: 'list', 23 schema: { 24 c: true, 25 d: true 26 } 27 } 28} 29export const someStore = persist(schema)(data) 30hydrate('some', someStore); 31console.log('someStore has been hydrated')
with initial state
1const initialState = window.__STATE__.some || { 2 obj: { a: 2, b: 1 } 3} 4export const someStore = new SomeStore() 5 6hydrate('some', someStore, initialState) 7 .then(() => console.log('some hydrated'))
re-hydration
1const result = hydrate('some', someStore, initialState) 2const rehydrate = result.rehydrate 3console.log('some hydrated') 4 5setTimeout(() => { 6 rehydrate(); 7 console.log('rehydrated') 8}, 3000)
persist(schema)(object)
'object' | 'list' | 'map'
or a structured schema object.create(config)
hydrate(key, store, initialState?, customArgs?)
IHydrateResult
extends function
No vulnerabilities found.
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 4/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More