File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,20 @@ modules directly from the namespace::
108
108
Module hooks
109
109
------------
110
110
111
- This is a list of module hooks, when they are called, and what arguments they
112
- receive.
111
+ Hooks are called by the application in order to delegate work to registered
112
+ modules. This is a list of module hooks, when they are called, and what
113
+ arguments they receive.
114
+
115
+ It is possible to add your own hooks to your application by invoking the
116
+ :func: `~annotator.App.prototype.runHook ` method on the application instance.
117
+ The return value is a :term: `Promise ` that resolves to an ``Array `` of the
118
+ results of the functions registered for that hook (the order of which is
119
+ undefined).
120
+
121
+ Hook functions may return a value or a :term: `Promise `. The latter is sometimes
122
+ useful for delaying actions. For example, you may wish to return a
123
+ :term: `Promise ` from the ``beforeAnnotationCreated `` hook when an asynchronous
124
+ task must complete before the annotation data can be saved.
113
125
114
126
115
127
.. function :: configure(registry)
You can’t perform that action at this time.
0 commit comments