UNPKG

launch.io

Version:

Launch.IO is an Ultra Hip, Simple, and Fast, Time Traveling React State Management Library

17 lines (16 loc) 860 B
import { LaunchContext } from "../types"; /** * A React hook that takes a `selector` function. The selector function receives a context, containing `state` and `actions`, and it should return object containing Launch.IO state and/or actions. * * `const selection = useLaunch({ state, actions} => ({ ... }));` * * `state` is an object that will contain the full application state. * These can be accessed via the name of the service along with the associating state property. * For example, `state.[ServiceName].[ServiceStateProperty]` * * `actions` is an object that will contain the full application launch actions. * These can be accessed via the name of the service along with the associating action. * For example, `actions.[ServiceName].[LaunchAction]` * */ export declare const useLaunch: <T>(selector: (context: LaunchContext) => T) => T;