@fluentui/state
    TypeScript icon, indicating that this package has built-in type declarations

    0.60.1 • Public • Published

    @fluentui/state

    A set of utils to create framework agnostic and reusable state managers.

    Installation

    NPM

    npm install --save @fluentui/state

    Yarn

    yarn add @fluentui/state

    Usage

    import { createManager, ManagerFactory } from '@fluentui/state';
    
    type InputState = { value: string };
    type InputActions = { change: (value: string) => void };
    
    const createInputManager: ManagerFactory<InputState, InputActions> = config =>
      createManager<InputState, InputActions>({
        ...config,
        actions: {
          change: (value: string) => () => ({ value }),
        },
        state: { value: '', ...config.state },
      });
    const manager = createInputManager({ state: { value: 'Hello world!' } });

    Usage with React

    We provide React bindings under @fluentui/react-bindings.

    Keywords

    none

    Install

    npm i @fluentui/state

    DownloadsWeekly Downloads

    13,404

    Version

    0.60.1

    License

    MIT

    Unpacked Size

    70.4 kB

    Total Files

    52

    Last publish

    Collaborators

    • microsoft1es
    • ecraig12345_msft
    • justslone
    • chrisdholt
    • miroslavstastny
    • levithomason
    • uifabricteam
    • uifrnbot
    • dzearing
    • layershifter
    • ling1726
    • allsnow
    • travisspomer