visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Global access to defined paths & callbacks #481

Open drschwabe opened 6 years ago

drschwabe commented 6 years ago

Is there a way to access the defined paths & callbacks from our app's global scope ?

This data is actually in the page.callbacks object but it's within function scope and thus unavailable to the outside; ie- seems that accessing this scoped data is not trivial without use of eval() or something.

screenshot from 2018-04-25 21-48-23

I was hoping to iterate over all the paths / callbacks in my Page.js powered app to create a sort of UI widget (ie- HTML list of links to each path (and callback, which would run on click obviously))