Skip to content

Adds publish/share/refCount operators and respective tests#6

Open
christophstrasen wants to merge 1 commit into4O4:masterfrom
christophstrasen:upstream-clean
Open

Adds publish/share/refCount operators and respective tests#6
christophstrasen wants to merge 1 commit into4O4:masterfrom
christophstrasen:upstream-clean

Conversation

@christophstrasen
Copy link
Copy Markdown

@christophstrasen christophstrasen commented Dec 4, 2025

Adds three familiar Rx operators:

  • publish: make a cold observable connectable
  • refCount: auto connect/disconnect based on subscribers
  • share: publish()->refCount() sugar

I lean on these in LQR to fan out streams without resubscribing upstream. Figured they belong in core so others can use the same patterns. Tests included and wired into the operator suite but I lack the travisCI setup to run them so apologies if something fails.

Mad props to you for the work on lua-reactivex :)

@4O4
Copy link
Copy Markdown
Owner

4O4 commented Jan 5, 2026

Hi, thank you for your contribution 🎉 I will review it in the upcoming days

@christophstrasen
Copy link
Copy Markdown
Author

Appreciated :).

And FYI on the main branch I maintain a more "radical" change for compatibibility with more restrictive lua environments but that may be a bridge too far to upstream so I did not make a PR for that. https://github.com/christophstrasen/lua-reactivex/tree/main

Cheers

@4O4
Copy link
Copy Markdown
Owner

4O4 commented Jan 14, 2026

Oh that's neat! Actually I would be okay with integrating more platform-specific changes as long as we can keep compatibility for different platforms. My own usage was also always outside of Love2D scope, but I always postponed adding more information about it 🙈

@christophstrasen
Copy link
Copy Markdown
Author

christophstrasen commented Mar 14, 2026

Good to know! What do you propose? Integrate all the changes? I'd be happy not to have a fork :) .

I used love2d for some of my visual testing, so the runtimes I have cough cough "tested" this change in are: Lua 5.1.5 CLI, Love2d, Zomboid Kahlua.

p.s.: Had some RL things going on so just replying now.

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.

2 participants