Thanks for the feedback! Just wanted to clarify some points:
I should probably have noted that the usage of console.log is illustrative and is typically only used for debugging (the idea being that console.log could be used in Firefox, or you could wrap it in a log helper function, or use alert or whatever).
Typically, in a Mithril app, you'd either assign the promise to a variable or bind to an m.prop at the end of the chain, as per the docs on web services ( http://lhorie.github.io/mithril/web-services.html )
Regarding console.log returning undefined: Mithril does deviate from A+ promises (again, as per the docs - http://lhorie.github.io/mithril/mithril.deferred.html ). The reason for the spec deviation is precisely to allow the use case of mixing procedural impurity into a chain (whereas the undefined case covered by the spec isn't really useful, given that undefined is the lack of a value, as opposed to null, which is a value with no meaning).
@anaphor: huh, reading about currying again, you're right. Little misunderstanding on my part. Sorry about that.
That's okay, I've seen people with PhDs confuse them before, it's a common mistake, and currying gets you partial application "for free". Good article nevertheless!
Thanks for the feedback! Just wanted to clarify some points:
I should probably have noted that the usage of console.log is illustrative and is typically only used for debugging (the idea being that console.log could be used in Firefox, or you could wrap it in a log helper function, or use alert or whatever).
Typically, in a Mithril app, you'd either assign the promise to a variable or bind to an m.prop at the end of the chain, as per the docs on web services ( http://lhorie.github.io/mithril/web-services.html )
Regarding console.log returning undefined: Mithril does deviate from A+ promises (again, as per the docs - http://lhorie.github.io/mithril/mithril.deferred.html ). The reason for the spec deviation is precisely to allow the use case of mixing procedural impurity into a chain (whereas the undefined case covered by the spec isn't really useful, given that undefined is the lack of a value, as opposed to null, which is a value with no meaning).
@anaphor: huh, reading about currying again, you're right. Little misunderstanding on my part. Sorry about that.