0.7.0 • Published 9 years ago

flambeau v0.7.0

Weekly downloads
18
License
Apache-2.0
Repository
github
Last release
9 years ago

Flambeau

A lightweight, Redux-compatible Flux library with opinions:

Declarative action creators

  • No UPPERCASE_CONSTANTS. Just use an exported function to name the action, and a destructured object to document the payload.
export function addTodo({ text }) {} // No constants, self-documenting payload
  • Better organized actions with namespacing using action sets.
  • Async action support built-in, with convenient dispatching of other actions.

Reusable reducers

  • No switch statements to handle actions, just declare a function with the same name as the action’s function, within an exported object named after the action set.
export const TodoListActions = {
  addTodo(state, { text }) {
    return state.concat({ text });
  }
}
  • Redux-style reducers instead of stores, using pure functions to allow clear data flow and immutability.
  • Reusable reducers, using props to customize the initial state or response to actions.
export function getInitialState({ initialItems = [] }) {
  return {
    items: initialItems
  };
}
  • Bulk forwarding of action sets within reducers to allow easy composition of reducers, such as in collections or other hierarchies.

Reducer state encapsulation

  • Introspection methods to allow encapsulation of reducers’ internal state. This removes action creators’ knowledge of the store’s structure, allowing greater code reuse.
  • Get a consensus for async actions, such as whether something needs loading, by polling reducers using their introspection methods.

Installation

npm install flambeau --save

Documentation

Example

See the async redux demo example for a full example of introspection and the features of Flambeau.

0.7.0

9 years ago

0.7.0-a1

9 years ago

0.6.1-a3

9 years ago

0.6.1-a2

9 years ago

0.6.1-a

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago