smartprocure/futil-js

Full promises async/await functionality to lodash

anodynos opened this issue · 4 comments

Any chance of implementing something that provides full promises & async/await functionality to lodash?

I'm getting ideas from things like promdash or Aigle lodash mixin (read more here that unfortunately aren't that mainstream for serious adoption....

Hi there! Thanks for the suggestion and I'm always happy to see new faces.

It's definitely on the radar - we've discussed it in #107 and #194. The flowAsync and some variations have already popped up in a few places - it's about time we formalize it into futil. We also have some upcoming work around our tree API to unify sync/async where this will be necessary.

Stay tuned - more to come here 👍

Hi @anodynos! You may want to check out #411. flowAsync and flowAsyncDeep should address most use cases. I'd love to get feedback from as many users as possible on this.

Specifically compared to the links you shared (promdash, Aigle, etc), F.flowAsync has some major advantages:

  • Nothing is reimplemented, so you can use it with existing lodash/ramda/etc methods
  • It only becomes async when it needs to, so it's safe to use generally even when you're not doing async stuff.
  • It automatically handles cases like objects with promise values (and in the case of flowAsyncDeep, promises anywhere in the object graph)

1.74 is live on npm! Happy to answer any usage questions you might have @anodynos

Thanks @daedalus28 - I will give it a try on 1st chance and get back to you!