Streamfor
A quick demonstration app for CableReady's broadcast_to method and StimulusReflex Nothing Morphs.
Install / Use
/learn @leastbad/StreamforREADME
CableReady broadcast_to example
Goal
Broadcasting to a resource - where you're sending based on what you're looking at instead of who you are - is easy and powerful. This example combines StimulusReflex's "Nothing Morph" concept - a light-weight RPC mechanism - to instruct CableReady to broadcast to everyone's favourite resource, current_user (which is being converted to User#1).
You can find out more in the CableReady Docs.
Setup
- Install and run Redis
- Clone this repo to your machine and go to the project folder
- Run
bin/setup - Start the server with
rails s - Open your browser's Console Inspector and go to
localhost:3000 - Login as
test@test.comwith the passwordtopsecretor create your own account
Note that caching in development is locked in the "on" position. This is a good thing.
Code review
Part of the reason this example is so powerful is that there's very little to it. That's why it's exciting.
Still, the files you're interested in are likely:
- app/reflexes/example_reflex.rb
- app/channels/application_cable/connection.rb
- app/channels/users_channel.rb
- app/javascript/channels/users_channel.js
Support
Please bring your questions to Discord. We'll be happy to help.
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
