Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 735 Bytes

File metadata and controls

31 lines (24 loc) · 735 Bytes

react-native-app-helpers/FiniteStateMachineRoutingProps

Props to be given to finite state machine routing components.

Usage

import type { FiniteStateMachineRoutingProps, FiniteStateMachineRouterState } from "react-native-app-helpers";

type RouteAParameters = null;
type RouteBParameters = { readonly value: number };

type RouteParameters = {
  routeAKey: RouteAParameters,
  routeBKey: RouteBParameters,
};

type OtherProps = {
  readonly exampleOtherPropKey: "Example Other Prop Value",
};

const example: FiniteStateMachineRoutingProps = {
  routeState: {
    key: `routeAKey`,
    parameters: null,
  },
  setRouteState(to: FiniteStateMachineRouterState<RouteParameters>): void {
    console.log(to);
  },
};