@toba/state
v2.1.3
Published
React State
Downloads
23
Readme
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.