Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Object
// .keys(res[lang])
// .forEach((namespace) => {
// i18next.addResourceBundle(lang, namespace, res[lang][namespace], true, true );
// })
// ;
// })
// ;
//
// module.hot.emit('loaded');
// });
// }
const sagaMiddleware = createSagaMiddleware();
const history = createHashHistory();
const initialState = INITIAL_STATE.set(PATH_MESSAGE_FLOW, loadMessageFlow())
.setIn(WATCHERS_PATH, loadWatchers());
console.log("initial state", initialState.toJSON());
const store = createStore(
reducer,
initialState,
composeWithDevTools(
applyMiddleware(sagaMiddleware) as StoreEnhancer,
) as StoreEnhancer,
);
//Register localStorage sync
store.subscribe(() => {
import React from 'react';
import {BrowserRouter as Router, Route, Link, Redirect, HashRouter} from 'react-router-dom'
import {createBrowserHistory, createHashHistory} from 'history'
const history = createHashHistory()
//引入组件
import Home from "./home.jsx";
import Topics from "./topics.jsx";
import About from "./about.jsx";
import {ButtonGroup, Button} from 'react-bootstrap';
import {increaseAction, multiAction} from '../action.js';
import {connect} from 'react-redux';
import {Tab, Tabs} from 'react-bootstrap';
// React component
class Basic extends React.Component {
constructor(props) {
super(props);
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import { createHashHistory } from 'history';
import { routerMiddleware, routerActions } from 'react-router-redux';
import { createLogger } from 'redux-logger';
import rootReducer from '../reducers';
import * as electronActions from '../actions/electron';
import * as settingsActions from '../actions/settings';
import * as itemsActions from '../actions/items';
const history = createHashHistory();
const configureStore = (initialState) => {
// Redux Configuration
const middleware = [];
const enhancers = [];
// Thunk Middleware
middleware.push(thunk);
// Logging Middleware
const logger = createLogger({
level: 'info',
collapsed: true
});
middleware.push(logger);
// @flow
import type { Store } from 'redux';
import { applyMiddleware, compose, createStore } from 'redux';
import thunk from 'redux-thunk';
import { createHashHistory } from 'history';
import { routerMiddleware } from 'react-router-redux';
import type { GlobalState } from '../reducers';
import rootReducer from '../reducers';
import { persistStore } from './persistStore';
import type { Dispatch } from '../actions/action.d';
const history = createHashHistory();
const router = routerMiddleware(history);
const enhancer = compose(applyMiddleware(thunk, router));
function configureStore(initialState?: GlobalState): Store<*, *, Dispatch> {
const store = createStore(rootReducer, initialState, enhancer);
persistStore(store);
return store;
}
export default { configureStore, history };
createCompressor(),
];
const persistOptions = {
key: 'v0',
storage: localForage,
stateReconciler: autoMergeLevel2,
whitelist: whiteListedReducers,
// Order is important. Needs to be compressed last or other transforms can't
// read the data
transforms,
};
let history;
// @if TARGET='app'
history = createHashHistory();
// @endif
// @if TARGET='web'
history = createBrowserHistory();
// @endif
const triggerSharedStateActions = [
ACTIONS.CHANNEL_SUBSCRIBE,
ACTIONS.CHANNEL_UNSUBSCRIBE,
LBRY_REDUX_ACTIONS.TOGGLE_TAG_FOLLOW,
LBRY_REDUX_ACTIONS.TOGGLE_BLOCK_CHANNEL,
LBRY_REDUX_ACTIONS.CREATE_CHANNEL_COMPLETED,
LBRY_REDUX_ACTIONS.SHARED_PREFERENCE_SET,
];
/**
* source: the reducer name
import React, { Component } from 'react';
import { Input, Button, Checkbox, Grid, Feedback } from '@icedesign/base';
import {
FormBinderWrapper as IceFormBinderWrapper,
FormBinder as IceFormBinder,
FormError as IceFormError,
} from '@icedesign/form-binder';
import IceIcon from '@icedesign/icon';
import './UserLogin.scss';
const { Row, Col } = Grid;
import lmmNet from '../../../../utils/lmmNet'
import { createHashHistory } from 'history';
const hashHistory = createHashHistory();
// 寻找背景图片可以从 https://unsplash.com/ 寻找
const backgroundImage =
'https://img.alicdn.com/tfs/TB1zsNhXTtYBeNjy1XdXXXXyVXa-2252-1500.png';
const loopTreeData = (data, pid) => {
var result = [], temp;
for (var i = 0; i < data.length; i++) {
if (data[i].pmenuId == pid) {
var obj = {
"id":data[i].menuId,
"pid":data[i].pmenuId,
"title": data[i].name,
"key":data[i].menuKey,
"tag":data[i].tag,
"icon":data[i].icon,
import { createStore, applyMiddleware, compose } from 'redux'
import thunk from 'redux-thunk'
import { routerMiddleware } from 'react-router-redux'
import { createHashHistory } from 'history'
import reducer, { initialState } from './reducers'
export const history = createHashHistory({
basname: '',
hashType: 'slash',
})
const middleware = routerMiddleware(history)
let middlewares
if (process.env.NODE_ENV === 'development') {
const DevTools = require('./devTools')
middlewares = compose(
applyMiddleware(thunk, middleware),
// Required! Enable Redux DevTools with the monitors you chose
DevTools.default.instrument()
)
} else {
middlewares = compose(applyMiddleware(thunk, middleware))
}
import { createHashHistory } from 'history';
import changeActiveMenu from 'Root/actions/activeMenu/change';
const history = createHashHistory();
history.listen((location) => {
changeActiveMenu(location.pathname);
});
if (process.env.NODE_ENV === 'development') {
global.myHistory = history;
}
export default history;
import React, {Component} from 'react'
import {DropdownItem, DropdownMenu, DropdownToggle} from 'reactstrap'
import {AppHeaderDropdown} from '@coreui/react'
import {connect} from 'react-redux'
import {createHashHistory} from 'history'
import actions from '../../../actions'
const history = createHashHistory()
const {getOwnUser} = actions
class AccountDropdown extends Component {
constructor(props){
super(props)
this.state = {
user_name: '',
first_name: '',
last_name: '',
email: ''
}
this.callback = this.callback.bind(this)
}
componentDidMount(){
this.props.getOwnUser(this.callback)
}