Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Latest commit

 

History

History
53 lines (39 loc) · 1.51 KB

README.md

File metadata and controls

53 lines (39 loc) · 1.51 KB

npm package Build Status Code style Dependencies DevDependencies Test Coverage

Toba State

Flux pattern state management.

Usage

yarn add @toba/state

Example

import React from 'react';
import { State, StateStore, flux } from '@toba/state';

export interface UserState extends State {
   notifications: string[];
   signedIn: boolean;
   fullName?: string;
   photoURL?: string;
   status: Status;
}

class Store extends StateStore<UserState> {
   constructor() {
      super({
         notifications: [] as string[],
         signedIn: false,
         status: null
      });
   }
}

export const userStore = flux.subscribe(new Store());

License

Copyright © 2019 Jason Abbott

This software is licensed under the MIT license. See the LICENSE file accompanying this software for terms of use.