registry.js | |
bbop. | BBOP generic lightweight listener/callback registry system. |
Functions | |
registry | Contructor for BBOP registry. |
register | Add the specified function from the registry, with an optional relative priority against other callback functions. |
is_registered | Returns whether or not an id has already been registered to a category. |
unregister | Remove the specified function from the registry. |
get_callbacks | Generic getter for callback functions, returns by priority. |
apply_callbacks | Generic runner for prioritized callbacks with various arguments and an optional change in context.. |
BBOP generic lightweight listener/callback registry system.
Functions | |
registry | Contructor for BBOP registry. |
register | Add the specified function from the registry, with an optional relative priority against other callback functions. |
is_registered | Returns whether or not an id has already been registered to a category. |
unregister | Remove the specified function from the registry. |
get_callbacks | Generic getter for callback functions, returns by priority. |
apply_callbacks | Generic runner for prioritized callbacks with various arguments and an optional change in context.. |
this.register = function( category, function_id, in_function, in_priority )
Add the specified function from the registry, with an optional relative priority against other callback functions.
The in_priority value is relative to others in the category, with a higher priority...getting priority.
category | string; one of the pre-defined categories |
function_id | string; a unique string to identify a function |
in_function | function |
in_priority | [optional] number |
n/a
<apply>
this.is_registered = function( category, function_id )
Returns whether or not an id has already been registered to a category. Will return null if the category does not exist.
category | string; one of the pre-defined categories |
function_id | string; a unique string to identify a function |
true, false, or null
this.apply_callbacks = function( category, arg_list, context )
Generic runner for prioritized callbacks with various arguments and an optional change in context..
category | string |
arg_list | a list of arguments to pass to the function in the category |
context | [optional] the context to apply the arguments in |
n/a
Contructor for BBOP registry.
bbop.registry = function( evt_list )
Add the specified function from the registry, with an optional relative priority against other callback functions.
this.register = function( category, function_id, in_function, in_priority )
Returns whether or not an id has already been registered to a category.
this.is_registered = function( category, function_id )
Remove the specified function from the registry.
this.unregister = function( category, function_id )
Generic getter for callback functions, returns by priority.
this.get_callbacks = function( category )
Generic runner for prioritized callbacks with various arguments and an optional change in context..
this.apply_callbacks = function( category, arg_list, context )