How to use the fluxible/addons/connectToStores function in fluxible

To help you get started, we’ve selected a few fluxible examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeffhandley / strickland / test / fluxible-example / components / Application.js View on Github external
<nav selected="{this.props.currentPageName}">
                
            
        );
    },

    componentDidUpdate: function(prevProps, prevState) {
        const newProps = this.props;
        if (newProps.pageTitle === prevProps.pageTitle) {
            return;
        }
        document.title = newProps.pageTitle;
    }
});

var storesConnected = connectToStores(Application, [ApplicationStore],
    function (stores, props) {
        var appStore = stores.ApplicationStore;

        return {
            currentPageName: appStore.getCurrentPageName(),
            pageTitle: appStore.getPageTitle(),
            pages: appStore.getPages()
        };
    }
);

var contextProvided = provideContext(storesConnected, {
    validate: React.PropTypes.func.isRequired
});

export default handleHistory(contextProvided);</nav>