-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add TSubscriptionRef #2725
add TSubscriptionRef #2725
Conversation
🦋 Changeset detectedLatest commit: 55dcb28 The changes in this PR will be included in the next version bump. This PR includes changesets to release 32 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@mikearnaldi would love to get your feedback on this when you've got a moment. I think it's good to go but this is my first stab at adding a new module and I may have missed things. |
90c23d6
to
6445e04
Compare
removed some comments and debug stuff I accidentally left in internal |
Cc @tim-smart for a second review, I think I am fine with it albeit have some doubts about mixing stream with stm |
I'm curious what doubts you have about mixing stream and stm? The use case leading me to implement this is when I need the synchronization capabilities of stm but also need the value-over-time for things like rendering UI. |
Namely subscribing gives you back a non transactional primitive (Stream) I think I'd prefer if subscribing gave you a TDequeue like TPubSub does: export const subscribe: <A>(self: TPubSub<A>) => STM.STM<TQueue.TDequeue<A>> |
Hmm interesting. I'm not sure what benefit that would offer. I can't think of a use case right now when I'd want a TDequeue instead of a Stream. Did you have something in mind? |
The TQueue interface has all methods returning STM so they can be used transactionally. It's strictly more powerful as you can derive a Stream from a TQueue but not the opposite |
I'll update the PR with the requested changes later this week, thanks for the feedback! |
09e058a
to
48ec3d9
Compare
a50c2cf
to
d75140c
Compare
@tim-smart I think this is now in a good state, pls have a final review, feel free to merge directly is all looks good |
91b5932
to
90ceeab
Compare
@mikearnaldi thanks for finishing this up! |
* @since 3.10.0 | ||
* @category mutations | ||
*/ | ||
export const changesStream: <A>(self: TSubscriptionRef<A>) => Stream.Stream<A, never, never> = internal.changesStream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const changesStream: <A>(self: TSubscriptionRef<A>) => Stream.Stream<A, never, never> = internal.changesStream | |
export const changesStream: <A>(self: TSubscriptionRef<A>) => Stream.Stream<A> = internal.changesStream |
0a30192
to
743365d
Compare
a12af8a
to
35e1a10
Compare
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Co-authored-by: Michael Arnaldi <[email protected]> Co-authored-by: Tim <[email protected]>
Type
Description
Add TSubscriptionRef for STM
Related