Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Store #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Export Store #108

wants to merge 1 commit into from

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