@taqtile/ts-mobx-persist-extensions
TypeScript icon, indicating that this package has built-in type declarations

0.7.1 • Public • Published

Mobx Persist Extension Module

This module contains Mobx's Persist extensions.

Contents

Persist Store decorator

PersistStore is a decorator that abstracts the mobx-persist hydration process.

It automatically hydrates the store upon creation, streamlining store implementation and reducing boilerplate code. The selected storage is set to AsyncStorage.

Sample usage

import { PersistStore } from '@taqtile/mobx-extensions';

@Service() // Typedi
@PersistStore()
export class MyStore {
  @persist @observable foo: string; // Will be persisted in LocalForage/AsyncStorage
  @observable bar: string; // Will NOT be persisted
}

/@taqtile/ts-mobx-persist-extensions/

    Package Sidebar

    Install

    npm i @taqtile/ts-mobx-persist-extensions

    Weekly Downloads

    2

    Version

    0.7.1

    License

    MIT

    Unpacked Size

    5.62 kB

    Total Files

    10

    Last publish

    Collaborators

    • taqtile
    • tibawatanabe