Skip to content

Comments

Export Store#108

Open
mrk21 wants to merge 1 commit intoBinaryMuse:masterfrom
mrk21:export_store
Open

Export Store#108
mrk21 wants to merge 1 commit intoBinaryMuse:masterfrom
mrk21:export_store

Conversation

@mrk21
Copy link

@mrk21 mrk21 commented Feb 16, 2015

I changed to export the lib/store module. By using this directly, we will be able to create stores by using ES6 Classes style.

For example in TypeScript:

import Fluxxor = require('fluxxor');

interface MyStoreOption {
  value: number;
}

class MyStore extends Fluxxor.Store {
  options: MyStoreOption;

  constructor(options: MyStoreOption) {
    super();
    this.options = options;
    this.bindActions("ACTION_TYPE", this.handleActionType.bind(this));
  }

  handleActionType(payload: number) {
    // ...
  }
}

var myStore = new MyStore({value: 123});

In addition, this style is compatible with static typing languages such as TypeScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant