How to use the createHashHistory function from history

Find comprehensive JavaScript history.createHashHistory code examples handpicked from public code repositorys.

0
1
2
3
4
5
/**
 * History
 */

var history = require('history');
module.exports = history.createHashHistory();;
fork icon6
star icon18
watch icon4

36
37
38
39
40
41
42
43
44
45
  )(createStore);
}

var store = createStoreWithMiddleware(reducer);

var history = createHashHistory({queryKey: false});
syncReduxAndRouter(history, store);


function onUpdate() {
fork icon7
star icon13
watch icon10

+ 3 other calls in file

3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  _this.history = history.createHashHistory(_this.props);
  return _this;
}

var _proto = HashRouter.prototype;
fork icon0
star icon0
watch icon0

26
27
28
29
30
31
32
33
34
35
    switch (type) {
        case 'memory': return history.createMemoryHistory(options);
        case 'browser': return history.createBrowserHistory(options);
        case 'hash':
        default:
            return history.createHashHistory(options);
    }
}
class BrowserRouter {
    constructor(history) {
fork icon0
star icon0
watch icon0

3
4
5
6
7
8
9
10
11
12

var history, router

// Simplify instantiating the history module for peeps
function autoPickHistory (value, opts) {
  if (value === 'hash') return History.createHashHistory(opts)
  if (value === 'pushState') return History.createBrowserHistory(opts)
  if (value === 'virtual') return History.createMemoryHistory(opts)
  throw new Error("Invalid value '" + value + "' for 'history' option in vue.$routr")
}
fork icon0
star icon0
watch icon2