Echo JS 0.11.0

<~>

mxxx comments

mxxx 4506 days ago. link 1 point ▲ ▼
Agreed! But it's a clean pattern to utilise regardless.
mxxx 4507 days ago. link 1 point ▲ ▼
interesting article, but it always puts me off when someone makes a throwaway comment like 

"It could be Angular, lodash (you’re not still using underscore, are you?)..."


what's the problem with underscore?
mxxx 4507 days ago. link 1 point ▲ ▼
I wish more people would read this article. RequireJS allows you to use 'shim' directives to try and jimmy in support for non-AMD scripts, but it's really not difficult for people to bake in support for their modules.
mxxx 4535 days ago. link 1 point ▲ ▼
The event listeners in the example code are a bad pattern, namely the use of 'bind' without a matching 'unbind'. 

When binding callbacks on a View to events on a Model/Collection, it's preferable to use .listenTo(), since all bindings that are listenTo'd are unbound on View.remove().


Also if you are bind()ing directly, i'd be inclined to use on(), seeing as that's the method listed in the docs (bind is simply an alias of on).
mxxx 4603 days ago. link 1 point ▲ ▼
Wonder if they've open sourced it because it's dead.  This has been doing the rounds for years now.
mxxx 4603 days ago. link 2 points ▲ ▼
Great read. Was struggling to see use cases for some of the latter examples but definitely food for thought.
mxxx 4619 days ago. link 0 point ▲ ▼
commenting to boost myself up the leaderboards... ;)
mxxx 4653 days ago. link 1 point ▲ ▼
off the top of my head, i'd go with:


var path = require('path');
res.render(path.join(__dirname, 'someview.hjs'))
mxxx 4672 days ago. link 1 point ▲ ▼
yeah, jQuery promises are a bit closer than they used to be, but still not completely compliant. 

the classlist code they use has a fallback for IE (regex for class removal, string concat for adding).
[more]