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

Mixin factory in actions and stores #221

Closed
spoike opened this issue Feb 3, 2015 · 3 comments
Closed

Mixin factory in actions and stores #221

spoike opened this issue Feb 3, 2015 · 3 comments

Comments

@spoike
Copy link
Member

spoike commented Feb 3, 2015

It'd be nice if we could connect actions to stores and stores to components without actually requiring reflux. Currently you need to do this:

var React = require('react'),
    Reflux = require('reflux'),
    MyStore = require('./mystore.js');

module.exports = React.createComponent({
    mixins: [
        Reflux.connect(MyStore, 'myStore')
    ],
    render: function() { 
        this.state.myStore; // from the connect
        // ... 
    }
});

What I'd like is a possibility for stores to register themselves into a component like this (and similar with actions):

var React = require('react'),
    MyStore = require('./mystore.js');

module.exports = React.createComponent({
    mixins: [
        MyStore.pushState('myStore')
    ],
    render: function() {
        this.state.myStore; // from the pushState
        // ...
    }
});
@spoike
Copy link
Member Author

spoike commented Feb 4, 2015

See also the addition of filters in connect #222

@spoike
Copy link
Member Author

spoike commented Aug 11, 2015

Could be made as an extension to stores.

@spoike spoike added this to the 0.2.x milestone Aug 11, 2015
@spoike spoike modified the milestones: 0.3.1, 0.2.x Oct 13, 2015
@devinivy devinivy removed this from the 0.3.1 milestone Mar 9, 2016
@BryanGrezeszak
Copy link
Contributor

Considering what's going on with ES6 I don't think this is relevant anymore. Closing.

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

No branches or pull requests

3 participants