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
This commit is contained in:
parent
86c16820f7
commit
26b8d994ce
18 changed files with 28 additions and 445 deletions
|
|
@ -306,7 +306,7 @@ In the example above, the `users` stream is populated with the response data whe
|
|||
|
||||
#### Bidirectional bindings
|
||||
|
||||
Streams can also be populated from other higher order functions, such as [`m.withAttr`](withAttr.md)
|
||||
Streams can also be populated from event callbacks and similar.
|
||||
|
||||
```javascript
|
||||
// a stream
|
||||
|
|
@ -314,7 +314,7 @@ var user = stream("")
|
|||
|
||||
// a bi-directional binding to the stream
|
||||
m("input", {
|
||||
oninput: m.withAttr("value", user),
|
||||
oninput: function (e) { user(e.target.value) },
|
||||
value: user()
|
||||
})
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue