Ali Naci Erdem

Personal Blog

  • Computers
  • DIY
  • GitHub
  • LinkedIn
  • Support Me

js

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

Shadow DOM is still somewhat shady

22nd October 2017 / Leave a Comment

I was recently building a web app using Polymer 2.0 and need to include some SVG assets for wider resolution support. As you may know, Polymer fully supports native shadow DOM with the 2.0 version. When using a shadow DOM context, the style tag will apply the given CSS rules inside the shadow context. This … [Read more…]

Posted in: Computers Tagged: css, dom, JavaScript, js, polymer, Programming, Scope, shadow dom, style, web components

Simple Proxy Server Using Node.js to Bypass CORS

10th December 2016

Node.js is a javascript runtime based on Chromium’s V8 javascript engine. It is really simple to create a basic HTTP server using the node.js API and a web based proxy is just an HTTP server that relays incoming requests back to the original recipient. So we will capture the requests and forward them using a … [Read more…]

Posted in: Computers Tagged: cors, Debugging, JavaScript, js, node, nodejs, Programming, proxy, tutorial
1 2 Next »