Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #37227

Re: Howto rlelease the onmidimessage listener?

X-Received by 2002:a37:a9d1:: with SMTP id s200mr33755629qke.251.1568194499263; Wed, 11 Sep 2019 02:34:59 -0700 (PDT)
X-Received by 2002:a9d:7411:: with SMTP id n17mr5187679otk.118.1568194499041; Wed, 11 Sep 2019 02:34:59 -0700 (PDT)
Path csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!o24no7506517qtl.0!news-out.google.com!c11ni948qtp.0!nntp.google.com!o24no7506513qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.javascript
Date Wed, 11 Sep 2019 02:34:58 -0700 (PDT)
In-Reply-To <2ee6f8a1-220e-4618-899d-e82a30e2e3b4@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=84.217.168.4; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host 84.217.168.4
References <2ee6f8a1-220e-4618-899d-e82a30e2e3b4@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <272b5ef2-e206-4e7f-a4d2-cf9fde245409@googlegroups.com> (permalink)
Subject Re: Howto rlelease the onmidimessage listener?
From Jonas Thörnvall <jonas.thornvall@gmail.com>
Injection-Date Wed, 11 Sep 2019 09:34:59 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 44
Xref csiph.com comp.lang.javascript:37227

Show key headers only | View raw


Den onsdag 11 september 2019 kl. 08:39:21 UTC+2 skrev Jonas Thörnvall:
> This is the most common way people show howto implement inport listeners, they just scroll thru all.
> 
>  for (input = inputs.next(); input && !input.done; input = inputs.next()) {
>         input.value.onmidimessage = onMIDIMessage;
>   }
> 
> I have searched for howto release the listener but can not find information about it. Do anyone here know?
> 
> So instead i had the idea to reinitiate the whole requestMIDIAccess, that i thought would release the whole midiObject unfortunately is just created a new instance running on top.
> 
> So can anyone show me to information "preferably web example" on howto either.
> 
> release onMIDIMessage listener
> 
> OR
> 
> release requestMIDIAccess object/promise "whatever it is"

Can i ask why do not the webmidiAPI use add remove eventlistener?
Would it not been more logical with.

input.addEventListener("onMidiMessage");
input.removeEventListener("onMidiMessage");

and if inputs was an array instead of an iterator.
inputs[].addEventListener("onMidiMessage");
inputs[].removeEventListener("onMidiMessage");

Sometimes the solutions the guys who implement javascript just do not make sense  to me. I guess they have their reasons for implementing it the way they does, but it is totally beyond my understanding of the language.

How come i can search for hours but not come up with howto remove a listener for a port, isn't that fucking strange?

Either it is so cumberly hard to do that noone put the effort into do it. Or it is impossible. If someone put in the effort to do it, please post me the link.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Howto rlelease the onmidimessage listener? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-09-10 23:39 -0700
  Re: Howto rlelease the onmidimessage listener? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-09-10 23:51 -0700
    Re: Howto rlelease the onmidimessage listener? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-09-11 02:04 -0700
  Re: Howto rlelease the onmidimessage listener? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-09-11 02:34 -0700
  Re: Howto rlelease the onmidimessage listener? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-09-11 02:38 -0700
  Re: Howto rlelease the onmidimessage listener? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-09-11 13:16 -0700
    Re: Howto rlelease the onmidimessage listener? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-09-12 00:10 -0700

csiph-web