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

Flux pattern state management

License

Notifications You must be signed in to change notification settings

toba/state

Repository files navigation

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.

Releases

No releases published

Packages

No packages published