Ali Naci Erdem

Personal Blog

  • Computers
  • DIY
  • GitHub
  • LinkedIn
  • itch.io
  • Support Me

yield

The problem with async generators

21st January 2020 / 1 Comment

Let’s imagine that we want to manage cancellation of an async operation using generator functions in javascript. When a secondary event occurs, we can listen for it and force the generator function to return by calling its return method and handle cleanup in the finally block, which will always run before a generator returns. Say … [Read more…]

Posted in: Computers Tagged: async, cancel, cancellation, generator, iterator, JavaScript, js, promise, race, redux-saga, yield

Quick and dirty animaton with async/await

10th June 2018 / Leave a Comment

Animation is a pain if you do not know how it is implemented. Basically, you are updating a value with respect to time. This is generally done by calculating the time elapsed since the last frame and interpolating this value between its initial and final values. The interpolation needn’t be linear, there are many such … [Read more…]

Posted in: Computers Tagged: animation, async, asynchronous, await, Coroutine, event loop, frame, JavaScript, js, Programming, requestanimationframe, yield