LRDesign / NinjaScript

Javascript so unobtrusive, no one sees it coming.
25 stars 1 forks source link

Get report of all registered handlers by key #16

Closed IdahoEv closed 12 years ago

IdahoEv commented 12 years ago

Feature request for useful debugging tool: ask NinjaScript to output all symbols for which there are registered handlers.

For example, if I have:

    Ninja.respondToJson({ alert: function(msg) { ..stuff ..},  notice: function(msg) { .. stuff .. }}) 

defined in one file, and

    Ninja.respondToJson({  recommendation: function(recco) {.. stuff ..} })

in a second file, it would be nice to have NS be able to say:

Registered JSON Handlers: 'alert', 'notice', 'recommendation'.

nyarly commented 12 years ago

As of the most recent commit, try NinjaScript.jsonDispatcher.inspect() - result will be a list of all the paths into the JSON data that event handlers are registered on.