Skip to content

Replay subject#10

Open
triandco wants to merge 4 commits intofable-hub:mainfrom
triandco:feat/replay-subject
Open

Replay subject#10
triandco wants to merge 4 commits intofable-hub:mainfrom
triandco:feat/replay-subject

Conversation

@triandco
Copy link
Copy Markdown

@triandco triandco commented Sep 7, 2023

  • Implemented a variant of a subject that "replays" old values to new subscribers by emitting them when they first subscribe
  • Added two new test cases based on RxJs

Comment thread test/SubjectTest.fs
Comment on lines +128 to +130
// TODO: How should I be yielding here so that obv1.Notifications is populated?
// (I specifically don't want to emit a completion.)
do! Async.Sleep 1_000
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbrattli is there a better way to ensure the value is yielded without using Async.Sleep?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look, but currently on vacation so might take a few days 😬

Comment thread src/Subject.fs Outdated
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #10 (0da9516) into main (cb7f745) will increase coverage by 3.03%.
The diff coverage is 88.63%.

@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
+ Coverage   47.63%   50.67%   +3.03%     
==========================================
  Files          14       14              
  Lines        1100     1188      +88     
  Branches       44       46       +2     
==========================================
+ Hits          524      602      +78     
- Misses        564      572       +8     
- Partials       12       14       +2     
Flag Coverage Δ
unittests 50.67% <88.63%> (+3.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/Subject.fs 88.75% <88.50%> (-0.30%) ⬇️
src/AsyncObservable.fs 32.46% <100.00%> (+0.88%) ⬆️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants