wonka icon indicating copy to clipboard operation
wonka copied to clipboard

Add makeReplaySubject source

Open EliaECoyote opened this issue 5 years ago • 1 comments

This should act as a subject, with the addition of emitting immediately old values to new subscribers, in FIFO order.

The api could look like:

let makeReplaySubject: (bufferSize: int) => subjectT('a) = ....;

// example:
let subject = makeReplaySubject(5);

I'm currently working on a PR, @kitten please tell me if you think this could be useful!

EliaECoyote avatar Feb 21 '20 19:02 EliaECoyote

I was considering to add this already, since we use this in urql with some custom code!

Feel free to open a PR! I’d be happy to review this and get this feature in šŸ‘šŸ™Œ

kitten avatar Feb 23 '20 19:02 kitten