Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
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;
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()
};
}
)));
}
}
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;
iconElementRight={addIconButton}
onLeftIconButtonTouchTap={::this.onNavaTouchTap} />
);
}
}
App = connectToStores(App, [MetaStore], function(stores, props) {
return {
MetaStore: stores.MetaStore.getState()
};
});
App = handleHistory(App);
App = provideContext(App);
export default App;
{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) => ({
currentTitle: context.getStore('DocStore').getCurrentTitle() || '',
currentDoc: context.getStore('DocStore').getCurrent()
}))
),
{
query: PropTypes.object,
devtools: PropTypes.object
}
);
export default Application;
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) ||
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(),
};
}
)));
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;
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() {