low: loop generators support
betula opened this issue · comments
[] Improve cycle
to async operations and yield
notation.
cycle(async ([isCancelled]) => {
const data = await action;
if (isCancelled()) return;
// ...
});
cycle(function* (cancel) {
const data = yield action;
// ...
});
For supporting async cycle added a new function loop
.
import { signal, stoppable, loop } from 'realar';
const action = signal();
loop(async () => {
const stop = stoppable();
const data = await action;
if (stop.val) return;
// ...
});
No have support generators yet, it's will soon.
Declined