hi everyone,
someone could help me with the end of this programm?
i need to stop the runner when he cross the arrival line so we paly the jingle an we switch to mode2
thansks you for your help
<!DOCTYPE html>
RX Demo
<br>
<div class="highlight"><pre class="highlight plaintext"><code> pre {
border: 1px solid black;
}
</style>
</code></pre></div>
<p></head></p>
<p><body><br>
<input type="text"></input><button>Go</button><br>
<section><br>
</section><br>
<script></p>
<div class="highlight"><pre class="highlight plaintext"><code> const sorties = [];
const sectionSorties = document.currentScript.previousElementSibling;
for (var i = 0; i &lt; 5; i++) {
const elt = document.createElement("pre");
sorties.push(elt);
sectionSorties.appendChild(elt);
}
var input = rxjs.fromEvent(document.querySelector('input'), 'input');
input.subscribe(evt =&gt; sorties[0].innerHTML += evt.data);
input.pipe(
rxjs.operators.filter(evt =&gt; evt.target.value.length &gt; 4)
, rxjs.operators.map(evt =&gt; evt.target.value)
)
.subscribe(val =&gt; sorties[1].innerHTML = val);
rxjs.operators.delay(10000)
, rxjs.operators.throttleTime(5000)
, rxjs.operators.map(evt =&gt; evt.data.toUpperCase()))
.subscribe(value =&gt; sorties[2].innerHTML += value);
var click = rxjs.fromEvent(document.querySelector('button'), 'click');
click.subscribe(function (evt) { sorties[0].innerHTML = ""; });
input.pipe(
rxjs.operators.takeUntil(click)
, rxjs.operators.map(evt =&gt; evt.target.value)
)
.subscribe(value =&gt; sorties[3].innerHTML = value);
rxjs.merge(
input.pipe(rxjs.operators.map(evt =&gt; evt.target.value.length))
, click.pipe(rxjs.operators.map(evt =&gt; " * "))
)
.subscribe(value =&gt; sorties[4].innerHTML = value);
</script>
</code></pre></div>
<p></body></p>
<p></html></p>
Top comments (0)