Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 454 Bytes

File metadata and controls

17 lines (13 loc) · 454 Bytes

mobx-persist-store wrapper

If you want to use MMKV with mobx-persist-store, create the following storage object:

import { configurePersistable } from 'mobx-persist-store'

const storage = new MMKV()

configurePersistable({
  storage: {
    setItem: (key, data) => storage.set(key, data),
    getItem: (key) => storage.getString(key),
    removeItem: (key) => storage.delete(key),
  },
})