3 ms·
The "promises" way of writing that concisely would be: read_files(dir).then(get_stats).then(find_largest).then(callback, errback) Any exceptions in those
by tlrobinson 13y ago
The "promises" way of writing that concisely would be:
read_files(dir).then(get_stats).then(find_largest).then(callback, errback)
Any exceptions in those functions would propagated to the "errback". Not perfect but much better than the examples in the article would suggest.