Skip to content

Instantly share code, notes, and snippets.

@gtk2k
gtk2k / promisetoasyncawait.js
Last active December 31, 2017 09:12 — forked from anonymous/promisetoasyncawait.js
Promise版とasync/awai版
/*******************************************
* Promise版
*******************************************/
class MidiApi {
requestMIDI() {
return navigator.requestMIDIAccess().then(requestSuccess, requestError)
}
requestSuccess(midiAccess) {
this.inputs = midiAccess.inputs