Martin Malinda
1 min readAug 26, 2020

--

I didn’t actually play with generator functions myself too much because I didn’t have to. I let CAF handle generator functions for vue-concurrency. But as I understand it, it depends on the consumer of the generator function how it is handling it things — specifically, when it is calling for next() . The consumer can do then() on the last value and only afterwards call for next() or it could do something else entirely. CAF is waiting for promises to resolve which makes the generator function to behave like async function: https://github.com/getify/CAF/blob/master/src/caf.src.js#L224

ember-concurrency goes a bit further and it also manages some automatic task cancelling and XHR handling as part of generator function handling, which is something vue-concurrency could borrow as well.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Martin Malinda
Martin Malinda

Written by Martin Malinda

Creative through code. Inspired by nature. Currently building https://powersave.pro

No responses yet

Write a response