Type alias MeiosisCell<S>

MeiosisCell<S>: {
    getState: (() => S);
    nest: (<K>(prop: K) => MeiosisCell<S[K]>);
    nested: NestedViews<S>;
    state: S;
    states: Stream<S>;
    update: Update<S>;
}

Meiosis cell contains everything needed to access and update state.

Type Parameters

  • S

    the State type.

Type declaration

  • getState: (() => S)
      • (): S
      • Returns the current state. Useful in code where state may have changed elsewhere.

        Returns S

  • nest: (<K>(prop: K) => MeiosisCell<S[K]>)
      • <K>(prop: K): MeiosisCell<S[K]>
      • Produces a nested cell.

        Type Parameters

        • K extends Extract<keyof S, string>

        Parameters

        • prop: K

        Returns MeiosisCell<S[K]>

  • nested: NestedViews<S>

    Contains nested view components.

  • state: S

    The current state.

  • states: Stream<S>

    The stream of states.

  • update: Update<S>

    Function to update the state.

Generated using TypeDoc