twitchext

1.0.2 • Public • Published

TwitchExt

A drop-in wrapper around the Twitch Extension Helper, except it fixes the outstanding issues:

  • In the original window.Twitch.ext, you can only attach a single event listener for any given event. If both you and one of your libraries wanted to attach an onAuthorized listener, one of them would be replaced by the other. With this new TwitchExt, you can attach as many listeners as you want without worry.
  • In the original window.Twitch.ext, you couldn't use promises for asynchronous callbacks. With this new TwitchExt, you may return a promise from your callback, and it'll wait accordingly.

Usage

This module completely mirrors the window.Twitch.ext, and can be used as a drop-in replacement.

const TwitchExt = require("twitchext")
 
TwitchExt.onAuthorized(function(authorization) {
    console.log("We are authorized!", authorization)
})

To Do

This assumes that the Twitch Extension Helper is accessible at window.Twitch.ext. We should consider automatically injecting it if it isn't found. :]

Package Sidebar

Install

npm i twitchext

Repository

github.com

Weekly Downloads

1

Version

1.0.2

License

none

Unpacked Size

2.91 kB

Total Files

4

Last publish

Collaborators

  • ehgoodenough