remyzorg/pendulum

If the same event occurs several time between two instants, only the last one is visible

remyzorg opened this issue · 2 comments

  • improve the language with gathered signals to fix this
  • tried just by changing the type of events in ocaml to lists but then it's not
    possible anymore to get environnement values at anytime
  • add a syntax :
input items (fun items x -> x :: items);

and

input (newit : inputElement Js.t)
  (onkeydown (
      fun omm ev ->
        if newit##.value##.length > 0 && ev##.keyCode = 13 then
          newit##.value :: omm else omm) [])
;

or even

let%sync prog ?(items=fun items x -> x :: items) = ... 

other idea :

input (newit : inputElement Js.t) {
  onkeydown = fun items ev ->
    if newit##.value##.length > 0 && ev##.keyCode = 13 then
      newit##.value :: items else items) []);
};

This is partially fixed by commits e5ccff3 to 5514ec6 but todomvc is still not working.

The problem is the gathered event-based signal is not reset between instans, thus the the list it carries is never empty and it add all its elements everytime there is no way to access the signal and reset the value.

The only solution is to reset every geb signals at the end of each instants and maybe it's the behavior we want.