npm.io
0.4.0-beta.1 • Published 8 years ago

@chloe463/romuald

Licence
MIT
Version
0.4.0-beta.1
Deps
2
Size
74 kB
Vulns
8
Weekly
0
DeprecatedThis package is deprecated

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 */ }
    // });
  }
}

Keywords