Skip to content
Advertisement

Tag: ecmascript-6

How to remove event callback with parameters

I have a web application that page A has video, and page B doesn’t. The video has the onended event when it finishes video playback. I tried to remove the event before the component unmounts with removeEventListener, or the video ended event will be fired after I switched to page B. However, I cannot find the proper way to remove

Extending Promise base class typings

I am trying to extend Promise base class, with a static method and an instance method. I am having trouble with the typescript definitions. See my code below! With this code, when I try to defined Promise.timeout above, typescript gives me the error : Property timeout is a static member of type PromiseConstructor. If I try to define the typing

Babel with Internet Explorer

Why isn’t this working in IE11 ? I was under the impression that Babel will automatically convert new-style code to old-style. Is there some configuration setup to be done ? Answer Babel can transform language features from newer versions of JavaScript into equivalents in older versions. It can’t polyfill APIs which aren’t supported (like fetch). You would need to find

Advertisement