0.1.1 • Published 7 years ago

romuald v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

Romuald

Overview

Romuald is a simple flux framework (like redux) for Angular.

Usage

// Your state store class
import { Armory } from 'romuald';

@Injectable()
export class YourStore extends Armory<AppState> {
  constructor() {
    const initialState = {};
    super(initialState, reducerFunction);
  }
}
// On some component
export class AppComponent {
  constructor(private _store) {
  }

  someAction() {
    this._store.dispatch({
      type: '/* string */',
      payload: { /* payload to pass to reducer function */ }
    });

    // Or use `next`
    // this._store.next({
    //   type: '/* string */',
    //   payload: { /* payload to pass to reducer function */ }
    // });
  }
}
0.1.1

7 years ago

0.1.0

7 years ago