2.1.3 • Published 5 years ago

@toba/state v2.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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.

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago