aboutsummaryrefslogtreecommitdiffstats
path: root/packages/vold-utils/docs
diff options
context:
space:
mode:
authorNik Nyby <nikolas@gnu.org>2015-01-17 17:12:36 -0500
committerNik Nyby <nikolas@gnu.org>2015-01-17 17:12:36 -0500
commitada88090ead2c3b9d0804794c5f20f9b24d1c2b1 (patch)
tree2838a7eee6c5d74094216acebd86915e0ea1de42 /packages/vold-utils/docs
downloadlibrejsxul-ada88090ead2c3b9d0804794c5f20f9b24d1c2b1.tar.lz
librejsxul-ada88090ead2c3b9d0804794c5f20f9b24d1c2b1.tar.xz
librejsxul-ada88090ead2c3b9d0804794c5f20f9b24d1c2b1.zip
Import to new git repository
The old repository was using almost 100mb of space because of all the unnecessary files in the history. So I've imported the code to a new git repository. Unfortunately the history isn't viewable from this repository anymore. To see what happened with LibreJS before 2015, see the old Bazaar repo here: http://bzr.savannah.gnu.org/lh/librejs/
Diffstat (limited to 'packages/vold-utils/docs')
-rw-r--r--packages/vold-utils/docs/listen.md23
-rw-r--r--packages/vold-utils/docs/unload+.md20
2 files changed, 43 insertions, 0 deletions
diff --git a/packages/vold-utils/docs/listen.md b/packages/vold-utils/docs/listen.md
new file mode 100644
index 0000000..d19c6c6
--- /dev/null
+++ b/packages/vold-utils/docs/listen.md
@@ -0,0 +1,23 @@
+<!-- contributed by Erik Vold [erikvvold@gmail.com] -->
+
+The `listen` module allows modules to register listeners to elements that are
+automatically removed when the module unloads.
+
+<api name="listen">
+@function
+ Add listeners to run when unloading in a unload queue. Optionally scope the
+ callback to a container, e.g., window. Provide a way to run all the callbacks.
+
+@param container {object}
+ A container for the node, which a "unload" event will be attached to, this is
+ used to cancel the unload magic that would occur, to avoid memory leaks.
+@param node {object}
+ The node to listen to.
+@param event {string}
+ The event type, for example: "load", "click", ...
+@param callback {function}
+ A function to be called when the event occurs on the node.
+@param [capture] {boolean}
+ Indicates if the event should be captured. [See the `useCapture`
+ documentation here](https://developer.mozilla.org/en/DOM/element.addEventListener).
+</api>
diff --git a/packages/vold-utils/docs/unload+.md b/packages/vold-utils/docs/unload+.md
new file mode 100644
index 0000000..78693ef
--- /dev/null
+++ b/packages/vold-utils/docs/unload+.md
@@ -0,0 +1,20 @@
+<!-- contributed by Erik Vold [erikvvold@gmail.com] -->
+
+The `unload+` module allows modules to register callbacks that are called
+when they are unloaded, and associate unload functions to containers to have the
+unloader automatically deleted when the container unloads.
+
+<api name="unload">
+@function
+ Save callbacks to run when unloading in a unload queue. Optionally scope the
+ callback to a container, e.g., window. Provide a way to run all the callbacks.
+
+@param callback {function}
+ A function to be called when the module unloads.
+@param [container] {object}
+ Optional container object; if the container "unloads" before the module
+ unloads, then the associated callback is removed from the unload queue.
+@returns {function}
+ Returns a function which will allow one to remove the callback from the unload
+ queue.
+</api>