3 ms·
With continuations (I cannot read the elm page right now as it is stuck), you can write something like; return doItWith(getSomething()); where getSomething(
by tluyben2 14y ago
With continuations (I cannot read the elm page right now as it is stuck), you can write something like;
return doItWith(getSomething());
where getSomething() does something async. This is very clear and readable, in JS:
var result = function() { ... handle the returned value in here }
var self = this;
this.getSomething(function(something){
result(self.doItWith(something));
});
When you are wading through large JS chunks this really gets hard. I do code reviews for my employees and there is a lot of time wasted on fixing bugs related to these callback structures. It's just too easy to make mistakes. I'm not sure if elm or opa or ... are final solutions, but they do improve working with Javascript imho.