1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Extend documentation of withAttr

This commit is contained in:
Franz Liedke
2020-09-11 15:49:12 +02:00
parent 6e7c86ac50
commit abb896d430

View File

@@ -1,8 +1,12 @@
/**
* An event handler factory that makes it simpler to implement data
* binding for component event listeners.
* An event handler factory that makes it simpler to implement data binding
* for component event listeners.
*
* Replaces m.withAttr for mithril 2.0
* The handler created by this factory passes the DOM element's attribute
* identified by the first argument to the callback (usually a bidirectional
* Mithril stream: https://mithril.js.org/stream.html#bidirectional-bindings).
*
* Replaces m.withAttr for Mithril 2.0.
* @see https://mithril.js.org/archive/v0.2.5/mithril.withAttr.html
*/
export default (key: string, cb: Function) =>