Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IStore<T>

Signature for a Store instance.

Type parameters

  • T: Obj

    Plain javascript object that will become the store state.

Hierarchy

  • IStore

Index

Properties

Methods

Properties

Readonly $state

$state: T

Store instance data.

Methods

$commit

  • $commit<U>(mutation: string, payload?: U): any
  • Calls a store mutation from the Store.$mutations map passing in the data the it needs to perform its task.

    Type parameters

    • U

      Any valid javascript type.

    Parameters

    • mutation: string

      Name of the mutation to call.

    • Optional payload: U

      Value to pass to the mutation.

    Returns any

$dispatch

  • $dispatch<U>(action: string, payload?: U): any
  • Calls a store action from the Store.$actions map passing in the data the it needs to perform its task.

    Type parameters

    • U

      Any valid javascript type.

    Parameters

    • action: string

      Name of the action to call.

    • Optional payload: U

      Value to pass to the action.

    Returns any

$unwatch

  • Stop a function from executing when a $state property changes.

    Type parameters

    • U

    Parameters

    • propertyPath: string

      Path to the property on $state, if nested use the dot operator for ex nested.property.

    • watcher: WatcherFunction<U>

      Function to be removed from executing when the property at propertyPath changes.

    Returns void

$watch

  • Add a function to be executed when a $state property changes.

    Type parameters

    • U

    Parameters

    • propertyPath: string

      Path to the property on $state, if nested use the dot operator for ex nested.property.

    • watcher: WatcherFunction<U>

      Function to be called when the property at propertyPath changes.

    Returns WatcherFunction<U>

Generated using TypeDoc