News for hackers. Stuff that matters.

asimpledog

Reactive RxJS Elements for React

A simple counter button example: function App() { // clicks Subject const click$ = new Subject<number>(); // output Observable const output$ = click$.pipe( startWith(0), // start w/ 0 map((_, i) => i), // map click to it's index ); return <$button onClick={ click$ }> <$>{ output$ }</$> ...

( Read More... | no comments | on HN )
Re:Show HN: React NPM package for RxJS content on Thursday July 23, 2020 @08:13AM (#23926466)

    import React from 'react';
    import { $ } from 'react-rxjs-elements';

    function App(){
      return <div>
        <$>{ timer(0, 1000) } sec</$>
      </div>
    }
Re:Show HN: Text 2 Speech 2 Text, RxJS on Thursday July 16, 2020 @01:55PM (#23861704)
It turned out to be an issue in my code! Again, sorry for that and thanks for reporting this!

Should work now on FF, with those flags enabled (tested on FF78, MacOS)

Re:Show HN: Text 2 Speech 2 Text, RxJS on Thursday July 16, 2020 @11:37AM (#23860058)
a video proof that it does work in chrome: https://twitter.com/kddsky/status/1283764775151960071 :)
Re:Show HN: Text 2 Speech 2 Text, RxJS on Thursday July 16, 2020 @11:32AM (#23859995)
Ooops, my big bad, I'll add a memo regarding this!

I couldn't make it work in Firefox yet: FF has a limited support for SpeechRecognition, that is enabled only via a flag. Even then it didn't work with my example. I'll dig into it further!

Meanwhile, to lessen the disappointment:

You can try this example in desktop/android chrome

OR

In FF open about:config and turn on these flags media.webspeech.recognition.enable media.webspeech.recognition.force_enable

(remember to turn em off after)

And then try official MDN example for Speech Recognition: https://mdn.github.io/web-speech-api/speech-color-changer/

Sorry for the trouble!

Re:SVG via RxJS and JSX: Experiment Update on Friday December 20, 2019 @12:37PM (#21845837)

    <svg width="300" height="200" stroke="blue" fill="white">{
      range(0, 200, animationFrameScheduler).pipe(
        map(r => <circle cx="150" cy="100" r={ r } />),
        repeat()
      )
    }</svg>
Re:React-like RxJS-based framework (weird) on Wednesday December 04, 2019 @05:19AM (#21701023)

  import { timer } from 'rxjs';

  function App() {
    const ticks$ = timer(0, 1000);

    return <div>
      <h1>{ ticks$ }</h1>
      <p>seconds passed</p>
    </div>
  }