realar-project / realar

5 kB Advanced state manager for React
MIT License
44 stars 0 forks source link

very low: stop as argument for loop and cycle #51

Closed betula closed 3 years ago

betula commented 3 years ago
loop(async (stop) => {
  const data = await action;
  if (stop.val) return;
  // ...
});

loop(function* (stop) {
  const data = yield action;
  // ...
});

cycle((stop) => {
  this.a = a.val;
});

You need to take this as a shortcut to the stoppable mechanism.

betula commented 3 years ago

The loop removed in 0.6.0 cycle with stop function as a first argument added to "the stream of conciseness 0.7+ roadmap"