@virtuous/conductor-helpers
v1.0.0
Published
Helpers for the conductor.
Downloads
172
Readme
conductor-helpers
Useful helpers functions for Conductor.
Installation
Using npm:
npm i @virtuous/conductor-helpers -S
Usage:
import { getCurrentRoute } from '@virtuous/conductor-helpers';
const route = getCurrentRoute();
API
| Function | Returns |
|-------------------------------|-----------------------------------------------------------------------------|
| getCurrentAction() | string The most recent history action. |
| getCurrentRoute() | Object\|null Returns the current route. |
| getPreviousRoute() | Object\|null Returns the previous route. |
| getRouteById(string id) | Object\|null Returns a route with the given id. |
| getRouteStack() | Array Returns the complete history stack. |
| isRouteOpen(string pattern) | boolean Returns true if a matching route is found in the history stack. |
