abstract-state-router
Advanced tools
Comparing version 3.0.0 to 3.1.0
12
index.js
@@ -33,5 +33,6 @@ var StateState = require('./state-state') | ||
function handleError(event, err) { | ||
if (!stateProviderEmitter.emit(event, err)) { | ||
process.nextTick(function() { | ||
stateProviderEmitter.emit(event, err) | ||
console.error(err) | ||
} | ||
}) | ||
} | ||
@@ -223,2 +224,9 @@ | ||
} | ||
stateProviderEmitter.evaluateCurrentRoute = function evaluateCurrentRoute(defaultRoute, defaultParams) { | ||
return getDestinationUrl(defaultRoute, defaultParams).then(function(defaultPath) { | ||
hashRouter.evaluateCurrent(defaultPath) | ||
}).catch(function(err) { | ||
handleError('error', err) | ||
}) | ||
} | ||
@@ -225,0 +233,0 @@ return stateProviderEmitter |
{ | ||
"name": "abstract-state-router", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "The basics of a client-side state router ala the AngularJS ui-router, but without any DOM interactions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -68,2 +68,6 @@ To manage webapp states so that you don't have to deal with url paths or anything. | ||
# stateRouter.evaluateCurrentRoute(defaultRoute, defaultParameters) | ||
You'll want to call this once you've added all your initial states. It causes the current path to be evaluated, and will activate the current state. If the current path doesn't match the route of any available states, the browser gets sent to the default route provided. | ||
# State change flow | ||
@@ -70,0 +74,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
69361
2060
101
0