Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 780 Bytes

current.md

File metadata and controls

29 lines (23 loc) · 780 Bytes

current method

FlowRouter.current();
  • Returns {Object}

Get the current state of the router. This API is not reactive. If you need to watch the changes in the path simply use FlowRouter.watchPathChange().

Example

// route def: /apps/:appId
// url: /apps/this-is-my-app?show=yes&color=red

const current = FlowRouter.current();
console.log(current);

// prints following object
// {
//     path: "/apps/this-is-my-app?show=yes&color=red",
//     params: {appId: "this-is-my-app"},
//     queryParams: {show: "yes", color: "red"}
//     route: {pathDef: "/apps/:appId", name: "name-of-the-route"}
// }

Further reading