Andarist / Andarist/callbag-remember

Late-subscribing only works if early subscribing occurred

オープン
#7 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
3
フォーク
3
PR マージ指標
30日以内にマージされた PR はありません

説明

When a remembered source receives a value, that value is not emitted to late subscribers unless that source has already been subscribed to.

Perhaps this is the intended behavior, but to me this was unexpected. See: https://stackblitz.com/edit/js-t8rvxy?file=index.js

```
import remember from "callbag-remember";
import { pipe, forEach } from "callbag-basics";
import fromFunction from "callbag-from-function";

const { source, emitter } = fromFunction();

const rem$ = remember(source);

// Late subscription does not receive the value unless early subscription enabled
/*
pipe(
rem$,
forEach(value => {
console.log("early-subscribe", value);
})
);
*/

emitter(111);

setTimeout(() => {
pipe(
rem$,
forEach(value => {
console.log("late-subscribe", value);
})
);
}, 1000);

```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。