From abb896d430dacc0453f95430aef1db7a76a0d3d2 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 11 Sep 2020 15:49:12 +0200 Subject: [PATCH] Extend documentation of withAttr --- js/src/common/utils/withAttr.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/src/common/utils/withAttr.ts b/js/src/common/utils/withAttr.ts index da6d97b0c..682b54122 100644 --- a/js/src/common/utils/withAttr.ts +++ b/js/src/common/utils/withAttr.ts @@ -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) =>