bds

bdss

Brain Day State Service - Angular 2 State Management library

Showing:

Popularity

Downloads/wk

2

Maintenance

No Maintenance Data Available

Package

Dependencies

0

License

ISC

Type Definitions

Tree-Shakeable

No?

Readme

Brain Day State Service

Synopsis

An injectable service to provide a familiar and intuitive state container catered to Angular2.

Code Example

import { StoreService } from 'bdss';

  export class RenderTextComponent implements OnInit {
    private value: string;
    constructor(private store: StoreService) { }
    ngOnInit(): void {
        this.value = this.store.getState()['board'][this.id]
        this.store.subscribe(() => {
            this.value = this.store.getState()['board'][this.id]
        })
    }
}

Motivation

To simplify state management in angular2.

Installation

npm install bdss --save;

API Reference

addReducer(reducer: Function): void :Adds reducers to be run on state on invokation of DISPATCH.  

getState(): Object Returns a deep clone of state.

dispatch(action: Object): Object: Takes in action objects and checks for lock related commands before running state through reducers.

subscribe(fn: Function): Function : Subscribes a listener function to state changes and returns a function to unsubscribe the same listener function.

Tests

To Come ...

Contributors

github.com/eviscerare, github.com/soleiluwedu, github.com/ryanbas21

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100