Options
All
  • Public
  • Public/Protected
  • All
Menu

This is the core data store object in Unmagical, and it is an abstract data type.

Index

Entries

Const makeStore

  • en

    Makes store.

    ja

    storeを作る。

    Parameters

    • data: Json
      • en initial data
      • ja 初期データ
    • schemaDb: SchemaDb
      • en schema database
      • ja スキーマデータベース
    • validate: Validate
      • en validation function
      • ja バリデーション関数
    • trackUpdate: boolean
      • en if true, then store is created with update tracking in place.
      • ja trueならstoreはアップデートトラッキングをしている状態で作られます。

    Returns Store

    • en newly created store
    • ja 新しく作成されたstore

Const isSame

  • isSame(store0: Store, store1: Store): boolean

Const beginUpdateTracking

  • beginUpdateTracking(store: Store): Store

Const endUpdateTracking

  • endUpdateTracking(store: Store): [string, Store]

Const test

  • test(path: string, store: Store): boolean

Const get

  • get(path: string, store: Store): Json

Const getMdr

  • getMdr(path: string, store: Store): Mdr

Const setMdr

  • setMdr(path: string, mdr: Mdr, store: Store): Store
  • Low-level api. This function executes neither validation nor coercion.

    The value of MDR must be a scalar.

    Parameters

    • path: string
    • mdr: Mdr
    • store: Store

    Returns Store

Const add

  • add(path: string, value: Json, store: Store): Store
  • Adds value to store. `add' function of JSON patch.

    Parameters

    • path: string
    • value: Json
    • store: Store

    Returns Store

Const remove

  • remove(path: string, store: Store): Store
  • Removes a value specified by path from store. `remove' function of JSON patch.

    function

    Parameters

    • path: string
    • store: Store

    Returns Store

Const replace

  • replace(path: string, value: Json, store: Store): Store
  • Replaces a value specified by path into value. Implements replace function of JSON patch.

    function

    Parameters

    • path: string
    • value: Json
    • store: Store

    Returns Store

Const move

  • move(from: string, path: string, store: Store): Store
  • Moves a value located in from, to a location specified by path. Implements move function of JSON patch.

    function

    Parameters

    • from: string
    • path: string
    • store: Store

    Returns Store

Const copy

  • copy(from: string, path: string, store: Store): Store
  • Copies a value located in from, to a location specified by path. Impelementing copy function of JSON patch.

    function

    Parameters

    • from: string
    • path: string
    • store: Store

    Returns Store

Const validate

  • validate(path: string, store: Store): Store

Const mapDeep

  • mapDeep(f: (mdr: Mdr, path: string) => Mdr, path: string, store: Store): Store
  • By f, maps every mdr descending to a location specified by path.

    Parameters

    • f: (mdr: Mdr, path: string) => Mdr
        • Parameters

          • mdr: Mdr
          • path: string

          Returns Mdr

    • path: string
    • store: Store

    Returns Store

Const reduceDeep

  • reduceDeep<T>(f: (cur: T, mdr: Mdr, path: string) => T, cur: T, path: string, store: Store): T
  • By f, deeply reduces a subtree of path.

    Type parameters

    • T

    Parameters

    • f: (cur: T, mdr: Mdr, path: string) => T
        • (cur: T, mdr: Mdr, path: string): T
        • Parameters

          • cur: T
          • mdr: Mdr
          • path: string

          Returns T

    • cur: T
    • path: string
    • store: Store

    Returns T

Const duplicate

  • duplicate(path: string, fromStore: Store, toStore: Store): Store

Const setExtra

  • setExtra(name: string, info: Object, store: Store): Store

Const getExtra

  • getExtra(name: string, store: Store): Object

Const setPortal

  • setPortal(ret: any, onPromiseThen: any, store: Store): Store

Const doReturn

  • doReturn(store: Store): void

Const isStore

  • isStore(x: any): boolean

Generated using TypeDoc