Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Children

Children: VNode | string | number | null

Possibles children types

ActionResult

ActionResult<State>: Partial<State> | Promise<any> | null | void

The result of an action.

memberof

[App]

Type parameters

  • State

ActionType

ActionType<Data, State, Actions>: (data?: Data) => ((state: State, actions: Actions) => ActionResult<State>) | ActionResult<State>

Type parameters

  • Data

  • State

  • Actions

Type declaration

    • The interface for a single action implementation.

      memberof

      [App]

      Parameters

      • Optional data: Data

      Returns ((state: State, actions: Actions) => ActionResult<State>) | ActionResult<State>

ActionsType

ActionsType<State, Actions>: { [ P in keyof Actions]: ActionType<any, State, Actions> | ActionsType<any, Actions[P]> }

The interface for the actions tree implementation.

memberof

[App]

Type parameters

  • State

  • Actions

Functions

h

  • h<Attributes, ToAttributes>(nodeName: string | Component<Attributes, any, any, ToAttributes>, attributes?: Attributes, ...children: (Children | Children[])[]): VNode<ToAttributes> | View<any, any>
  • The soft way to create a VNode.

    remarks

    In unmagical, we added ToAttributes type parameter.
    Also we changed Element type from:

    interface Element extends VNode<any> {}
    

    to:

    type Element = VNode<any> | View<any, any>;
    
    memberof

    [VDOM]

    Type parameters

    • Attributes

    • ToAttributes

    Parameters

    • nodeName: string | Component<Attributes, any, any, ToAttributes>
    • Optional attributes: Attributes

      Any valid HTML atributes, events, styles, and meta data

    • Rest ...children: (Children | Children[])[]

      The children of the VNode

    Returns VNode<ToAttributes> | View<any, any>

    A VNode tree.

app

  • app<State, Actions>(state: State, actions: ActionsType<State, Actions>, view: View<State, Actions>, container: Element): Actions
  • The app() call creates and renders a new application.

    memberof

    [App]

    Type parameters

    • State

    • Actions

    Parameters

    • state: State

      The state object.

    • actions: ActionsType<State, Actions>

      The actions object implementation.

    • view: View<State, Actions>

      The view function.

    • container: Element

      The DOM element where the app will be rendered to.

    Returns Actions

    The actions wired to the application.

Generated using TypeDoc