Reactive data
crimaniak
crimaniak at gmail.com
Tue Apr 3 02:03:31 UTC 2018
On Saturday, 31 March 2018 at 16:08:36 UTC, lempiji wrote:
>
> -----------
> import rx;
>
> auto firstWord = new BehaviorSubject!string("Change");
> auto secondWord = new BehaviorSubject!string("me!");
>
> auto bothWords = new BehaviorSubject!string("");
> combineLatest!((a, b) => a ~ " " ~ b)(firstWord,
> secondWord).doSubscribe(bothWords);
>
> writeln(bothWords.value); // Change me!
>
> firstWord.value = "TEST";
> writeln(bothWords.value); // TEST me!
> -----------
Thanks! I will play with it.
More information about the Digitalmars-d-learn
mailing list