0.5.0-beta.18 • Published 2 years ago

@machinat/local-state v0.5.0-beta.18

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Local State Module

This module implement the BaseStateController with in-memory and file storage. We suggest to use them for testing purpose only.

Install

npm install @machinat/core @machinat/local-state
# or with yarn
yarn add @machinat/core @machinat/local-state

Docs

Check the Using State document for the usage guide, and the package reference for API details.

Setup

In-Memory State

import Machinat from '@machinat/core';
import { InMemoryState } from '@machinat/local-state';

const app = Machinat.createApp({
  modules: [
    InMemoryState.initModule(),
  ],
});

In-Memory State

import Machinat from '@machinat/core';
import { FileState } from '@machinat/local-state';
import YAML from 'yaml';

const app = Machinat.createApp({
  modules: [
    FileState.initModule({
      path: './.state_storage.json',
    }),
  ],
  services: [
    // you can swap the serializer
    { provide: FileState.Serializer, withValue: YAML }
  ],
});
0.5.0-beta.16

2 years ago

0.5.0-beta.14

2 years ago

0.5.0-beta.17

2 years ago

0.5.0-beta.18

2 years ago

0.5.0-beta.1

3 years ago

0.5.0-beta.0

3 years ago

0.4.1-alpha.44

3 years ago

0.4.1-alpha.34

3 years ago

0.4.1-alpha.33

3 years ago

0.4.1-alpha.29

3 years ago

0.4.1-alpha.28

3 years ago

0.4.1-alpha.27

3 years ago

0.4.1-alpha.23

3 years ago

0.4.1-alpha.21

3 years ago

0.4.1-alpha.8

3 years ago

0.4.1-alpha.3

3 years ago

0.4.1-alpha.1

3 years ago

0.4.0-beta.1

3 years ago