Flux pattern state management.
yarn add @toba/state
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());
Copyright © 2019 Jason Abbott
This software is licensed under the MIT license. See the LICENSE file accompanying this software for terms of use.