abstract-state-router
Advanced tools
Comparing version 7.3.1 to 7.4.0
@@ -614,5 +614,7 @@ 'use strict'; | ||
stateProviderEmitter.getActiveState = () => lastCompletelyLoadedState.get(); | ||
stateProviderEmitter.stateIsActive = (stateName, parameters = null) => { | ||
stateProviderEmitter.stateIsActive = (stateName = null, parameters = null) => { | ||
const currentState = lastCompletelyLoadedState.get(); | ||
const stateNameMatches = currentState.name === stateName || currentState.name.indexOf(stateName + `.`) === 0; | ||
const stateNameMatches = currentState.name === stateName | ||
|| currentState.name.indexOf(stateName + `.`) === 0 | ||
|| stateName === null; | ||
const parametersWereNotPassedIn = !parameters; | ||
@@ -619,0 +621,0 @@ |
{ | ||
"name": "abstract-state-router", | ||
"version": "7.3.1", | ||
"version": "7.4.0", | ||
"description": "Like ui-router, but without all the Angular. The best way to structure a single-page webapp.", | ||
@@ -5,0 +5,0 @@ "main": "bundle.js", |
@@ -254,3 +254,3 @@ **[Changelog](./changelog.md) • [Join the chat on Discord](https://discord.gg/G8FrErC) • [API documentation](#api)** | ||
## stateRouter.stateIsActive(stateName, [stateParameters]) | ||
## stateRouter.stateIsActive([stateName, [stateParameters]]) | ||
@@ -261,2 +261,4 @@ Returns true if `stateName` is the current active state, or an ancestor of the current active state... | ||
You can pass in `null` as the state name to see if the current state is active with a given set of parameters. | ||
```js | ||
@@ -268,2 +270,3 @@ // Current state name: app.tab1 | ||
stateRouter.stateIsActive('app') // => true | ||
stateRouter.stateIsActive(null, { fancy: 'yes' }) // => true | ||
``` | ||
@@ -270,0 +273,0 @@ |
Sorry, the diff of this file is not supported yet
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
86693
561
401