Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Cubiz<TState>

The cubiz is where to store the data. The application logic should place in effect body

Type parameters

  • TState = any

Hierarchy

Index

Properties

data: Record<string, any>

a shared data for effect level use

error: any

get last error

key: any

get the key of cubiz, by default, the key is undefined

loading: boolean

loading = true if the cubiz has calling effects

params: any

the parameters will be passed when creating cubiz

repository: Repository

get the repository that creates the cubiz

state: TState

get current state of the cubiz

type: Function

get the cubiz type, it is init function

Methods

  • bind(binder: any): void
  • call<TPayload, TResult>(effect: Effect<TState, TPayload, TResult>, ...args: TPayload): InferEffectResult<TResult>
  • call specified effect with payload

    Type parameters

    • TPayload: any[]

    • TResult

    Parameters

    • effect: Effect<TState, TPayload, TResult>
    • Rest ...args: TPayload

    Returns InferEffectResult<TResult>

  • dispose(): void
  • disposed(): boolean
  • spawn<TPayload, TResult>(effect: Effect<TState, TPayload, TResult>, ...args: TPayload): InferEffectResult<TResult>
  • Type parameters

    • TPayload: any[]

    • TResult

    Parameters

    • effect: Effect<TState, TPayload, TResult>
    • Rest ...args: TPayload

    Returns InferEffectResult<TResult>

  • unbind(binder: any): void

Generated using TypeDoc