How to use the fluxible-router.handleHistory function in fluxible-router

To help you get started, we’ve selected a few fluxible-router 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 mridgway / react-server / tests / fixtures / apps / chat / components / ChatApp.jsx View on Github external
var provideContext = require('fluxible/addons/provideContext');
var handleHistory = require('fluxible-router').handleHistory;

var ChatApp = React.createClass({
    render: function() {
        return React.cloneElement(
            <div>
                
                
            </div>
        );
    }
});

// wrap with history handler
ChatApp = handleHistory(ChatApp);

// and wrap that with context
ChatApp = provideContext(ChatApp);

module.exports = ChatApp;
github yahoo / fluxible / examples / chat / components / ChatApp.js View on Github external
var provideContext = require('fluxible-addons-react/provideContext');
var handleHistory = require('fluxible-router').handleHistory;

var ChatApp = React.createClass({
    render: function() {
        return (
            <div>
                
                
            </div>
        );
    }
});

// wrap with history handler
ChatApp = handleHistory(ChatApp);

// and wrap that with context
ChatApp = provideContext(ChatApp);

module.exports = ChatApp;
github yahoo / fluxible / packages / generator-fluxible / app / templates / components / Application.js View on Github external
componentDidUpdate(prevProps, prevState) {
        const newProps = this.props;
        if (newProps.pageTitle === prevProps.pageTitle) {
            return;
        }
        document.title = newProps.pageTitle;
    }
}

Application.propTypes = {
    currentRoute: PropTypes.object,
    pageTitle: PropTypes.string
};

export default provideContext(handleHistory(connectToStores(
    Application,
    [ApplicationStore],
    function (context, props) {
        var appStore = context.getStore(ApplicationStore);
        return {
            pageTitle: appStore.getPageTitle()
        };
    }
)));
github ali1k / ld-r / components / Application.js View on Github external
}
}

Application.contextTypes = {
    getStore: PropTypes.func,
    executeAction: PropTypes.func,
    getUser: PropTypes.func
};

Application = connectToStores(Application, [ApplicationStore], function (context, props) {
    return {
        ApplicationStore: context.getStore(ApplicationStore).getState()
    };
});

Application = handleHistory(Application, {enableScroll: false});

Application = provideContext(Application, { //jshint ignore:line
    getUser: PropTypes.func
});

export default Application;
github g0v / ppt / common / views / App.jsx View on Github external
iconElementRight={addIconButton}
            onLeftIconButtonTouchTap={::this.onNavaTouchTap} /&gt;
          
          
        
      );
    }
}

App = connectToStores(App, [MetaStore], function(stores, props) {
  return {
    MetaStore: stores.MetaStore.getState()
  };
});

App = handleHistory(App);

App = provideContext(App);

export default App;
github yahoo / fluxible / site / components / Application.js View on Github external
{Handler}
                
                <div role="footer" id="footer">
                    <div>
                        <small>All code on this site is licensed under the <a href="https://github.com/yahoo/fluxible.io/blob/master/LICENSE.md">Yahoo BSD License</a>, unless otherwise stated.</small> <small>© 2015 Yahoo! Inc. All rights reserved.</small>
                    </div>
                </div>
            
        );
    }
}


Application = provideContext(
    handleHistory(
        connectToStores(Application, ['DocStore'], (context) =&gt; ({
            currentTitle: context.getStore('DocStore').getCurrentTitle() || '',
            currentDoc: context.getStore('DocStore').getCurrent()
        }))
    ),
    {
        query: PropTypes.object,
        devtools: PropTypes.object
    }
);

export default Application;
github localnerve / react-pwa-reference / src / application / components / Application.jsx View on Github external
componentDidUpdate () {
    document.title = this.props.pageTitle;

    const analytics = window[this.props.analytics];
    if (analytics) {
      analytics('set', {
        title: this.props.pageTitle
      });
      analytics('send', 'pageview');
    }
  }
}

const application = provideContext(
  handleHistory(
    connectToStores(
      Application, ['ContentStore', 'RouteStore', 'ModalStore'], (context) => {
        const
          routeStore =
            context.getStore('RouteStore'),
          contentStore =
            context.getStore('ContentStore'),
          modalStore =
            context.getStore('ModalStore'),
          currentRoute =
            routeStore.getCurrentRoute(),
          pageName =
            (currentRoute && currentRoute.page) ||
              contentStore.getDefaultResource(),
          pageTitle =
            (currentRoute && currentRoute.pageTitle) ||
github slidewiki / slidewiki-platform / components / Application.js View on Github external
if(this.props.ErrorStore.error)
            context.executeAction(cleanStore);
    }
}
Application.contextTypes = {
    getStore: PropTypes.func,
    executeAction: PropTypes.func,
    getUser: PropTypes.func,
    intl: PropTypes.object.isRequired
};

Application = provideContext(Application, { //jshint ignore:line
    getUser: PropTypes.func
});

export default provideContext(handleHistory(connectToStores(
    DragDropContext(HTML5Backend)(Application),
    [ApplicationStore, ErrorStore],
    (context, props) => {
        let appStore = context.getStore(ApplicationStore);
        return {
            pageTitle: appStore.getPageTitle(),
            showActivationMessage: appStore.getActivationMessage(),
            ErrorStore: context.getStore(ErrorStore).getState(),
        };
    }
)));
github localnerve / flux-react-example / components / Application.jsx View on Github external
var routeStore = context.getStore('RouteStore'),
        appStore = context.getStore('ApplicationStore'),
        currentRoute = routeStore.getCurrentRoute(),
        pageName = (currentRoute && currentRoute.page) ||
          appStore.getDefaultPageName();

    return {
      navigateComplete: routeStore.isNavigateComplete(),
      pageName: pageName,
      pageTitle: appStore.getCurrentPageTitle(),
      pageModels: context.getStore('ContentStore').getCurrentPageModels(),
      pages: routeStore.getRoutes()
    };
});

Application = handleHistory(Application, {
  enableScroll: false
});

Application = provideContext(Application);

module.exports = Application;
github dockunit / platform / components / Application.jsx View on Github external
import React from 'react';
import Nav from './Nav';
import Login from './Login';
import GithubAuthorize from './GithubAuthorize';
import ApplicationStore from '../stores/ApplicationStore';
import readMyProjects from '../actions/readMyProjects';
import UserStore from '../stores/UserStore';
import updateShowDockunitSetup from '../actions/updateShowDockunitSetup';
import {connectToStores, provideContext} from 'fluxible-addons-react';
import {handleHistory} from 'fluxible-router';
import {navigateAction} from 'fluxible-router';
import DockunitSetup from './DockunitSetup';

@provideContext
@handleHistory({enableScroll: false})
@connectToStores(['ApplicationStore', 'UserStore'], (context, props) => ({
    ApplicationStore: context.getStore(ApplicationStore).getState(),
    UserStore: context.getStore(UserStore).getState()
}))
class Application extends React.Component {

    constructor(props, context) {
        super(props, context);
    }

    static contextTypes = {
        getStore: React.PropTypes.func,
        executeAction: React.PropTypes.func
    }

    componentDidMount() {