Skip to content
This repository was archived by the owner on Feb 19, 2022. It is now read-only.

Releases: FormidableLabs/biff

Adds 0.14 compatibility

Choose a tag to compare

@kenwheeler kenwheeler released this 19 Oct 19:00

Adds 0.14 compatibility

Thanks @iheanyi

0.1.6

Choose a tag to compare

@kenwheeler kenwheeler released this 03 Apr 12:54
  • Adds 'event' dependency for non-node environments (react-native)
  • Bumps simple-console to 0.1.1 to fix #8
  • Removes max listeners warning

0.1.5

Choose a tag to compare

@kenwheeler kenwheeler released this 31 Mar 23:43

Adds error logging to store callbacks

0.1.4

Choose a tag to compare

@kenwheeler kenwheeler released this 22 Mar 20:39

0.1.4 Adds a new feature where a composition component is added to the base Biff object in order to attach Biff Stores to components without using mixins. This component is used as shown below:

import Flux from '../dispatcher/dispatcher';
import TodoStore from '../stores/TodoStore';

let App = React.createClass({
...
});

App = Flux.connect(App, [TodoStore], props => ({
  todos: TodoStore.getTodos(),
  pending: TodoStore.getPending(),
  errors: TodoStore.getErrors()
}));

export default App;

Bug Fixes

Choose a tag to compare

@kenwheeler kenwheeler released this 07 Mar 13:28

0.1.3 fixes:

  • Fixes issue where data isn't passed to component mixins
  • Fixes issue where errors weren't cleared

0.1.3 features:

  • allows data to be passed through emitChange now as well

0.1.0

Choose a tag to compare

@kenwheeler kenwheeler released this 04 Mar 16:34

Breaking Changes

Action Creator syntax now requires explicit dispatches, see example below:

// OLD WAY

biff.createActions({
    myAction: function(arg1){
        return {
            actionType: 'MY_ACTION',
            prop1: arg1
        }
    }
});

// NEW WAY

biff.createActions({
    myAction: function(arg1){
        this.dispatch({
            actionType: 'MY_ACTION',
            prop1: arg1
        });
    }
});

New Features

Stores

Stores in Biff now have store state helpers. Each store object has a _pending property and an _errors array. These are exposed via the following getters and setters:

// Inside components, etc...
MyStore.getPending() // Returns _pending property
MyStore.getErrors() // Returns _errors array

// Inside a store's payload callback
this._setPending(value) // Sets the _pending property
this._setError(error) // Pushes an error onto the _errors array
this._clearErrors() // Clears the store's _errors array

In addition to stores being able to store errors, they can also emit errors back to the component using the emitChange method. Components can respond to this event using the storeError method.

// In a store's payload callback
if(error) {
    this.emitError(error);
}

// In a component
mixins: [MyStore.mixin],
storeError: function (error) {
    console.log(error);
}