Skip to content

Commit a1ec136

Browse files
authored
Remove m.prop + m.withAttr (#2317)
* Remove `m.prop` + `m.withAttr` - For many uses, `m.withAttr` is *more* verbose than just directly using an event handler - If you're using it with a bound callback, you're literally wasting a single character in the human readable version (and you're *saving* them in the minified output). - It sometimes obscures your intent, if overused. - Functions are easier to compress than `m.withAttr`, resulting in slightly smaller bundles. - `m.withAttr` is overused anyways. - `m.prop` is basically useless without `m.withAttr`, and the API doesn't have the same benefits it had with 0.2.x. * Update changelog
1 parent 1d2ed24 commit a1ec136

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

editor/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
view: function() {
2929
return [
3030
m("textarea.input", {
31-
oninput: m.withAttr("value", state.update),
31+
oninput: function (e) { state.update(e.traget.value) },
3232
value: state.text
3333
}),
3434
m(".preview", m.trust(marked(state.text))),

0 commit comments

Comments
 (0)