deef-router
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -39,3 +39,3 @@ 'use strict'; | ||
var on = function on(_ref) { | ||
var register = function register(_ref) { | ||
var history = _ref.history, | ||
@@ -100,3 +100,3 @@ _ref$compareMatchKeys = _ref.compareMatchKeys, | ||
}); | ||
// 先执行onBreakMatch,执行顺序按注册顺序从后到早 | ||
// 先执行onBreakMatch,执行顺序按注册顺序从晚到早 | ||
[].concat(execList).reverse().forEach(function (item) { | ||
@@ -114,6 +114,8 @@ item.onBreakMatch && item.onBreakMatch(); | ||
exports.default = function (_ref3) { | ||
var history = _ref3.history; | ||
var history = _ref3.history, | ||
compareMatchKeys = _ref3.compareMatchKeys; | ||
return { | ||
on: on({ history: history }) | ||
on: register({ history: history, compareMatchKeys: compareMatchKeys }), | ||
register: register({ history: history, compareMatchKeys: compareMatchKeys }) | ||
}; | ||
@@ -120,0 +122,0 @@ }; |
{ | ||
"name": "deef-router", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "deef router", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -14,3 +14,3 @@ /** | ||
const on = ({history, compareMatchKeys = COMPARE_MATCH_KEYS}) => (rule, {onMatch, onBreakMatch}, key) => { | ||
const register = ({history, compareMatchKeys = COMPARE_MATCH_KEYS}) => (rule, {onMatch, onBreakMatch}, key) => { | ||
// 一个rule只生效一次 | ||
@@ -75,5 +75,6 @@ let ruleKey = isString(key) && key; | ||
export default ({history}) => { | ||
export default ({history, compareMatchKeys}) => { | ||
return { | ||
on: on({history}) | ||
on: register({history, compareMatchKeys}), | ||
register: register({history, compareMatchKeys}) | ||
}; | ||
@@ -80,0 +81,0 @@ }; |
17508
362