Hey Rebecca,

There was a mistake in the shared code, since I was using Typescript typings inside a JS file.

I've updated the code in the article to fix that, but you can see the gist directly on github: https://gist.github.com/3nvi/91db00834bfd52bc4d8f0b29bf836c6b

P.S. At the end of the article, I'm linking to an OSS library I've created, which does everything I explain in this article and is probably a bit more stable than those code snippets. See if it suits your needs :)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store