Class Node<TSchema, TContext>

Type parameters

  • TSchema

  • TContext

Hierarchy

Index

Properties

data

data: TSchema

schemaVersion

schemaVersion: number

Methods

fromJSON

load

  • load(context: TContext): Promise<void>
  • The load method is responsible for taking the data saved in the data propertly and loading it into the application state. It is also responsible for calling load on all child nodes in the desired load order.

    Parameters

    • context: TContext

    Returns Promise<void>

migrate

  • migrate(version: number): void
  • Nodes that have evolved from schema version 1 should override this method. This function is responsible for changing this.data to match the current schema.

    Parameters

    • version: number

      The old version number

    Returns void

save

  • save(context: TContext): Promise<void>
  • The save method is responsible for taking the current application state and saving it into the data property. It is also responsible for calling save on all child nodes in the desired save order.

    Parameters

    • context: TContext

    Returns Promise<void>

toJSON