Releases: anycable/anycable-client
Releases · anycable/anycable-client
0.6.0
0.5.0
Features
- Channel instances are now decoupled from subscriptions, thus making it possible to create many channels with the same identifiers (a single subscription is created under the hood).
See the updated architecture docs.
Changes
cable.subscribe(channel)
is now synchronous and returns the passed channel itself, so you can chain the execution. The actualsubscribe
command is sent asynchrounously.
If you still want to wait for channel to be connected, you can use the new ensureSubscribed
function:
// Before
await cable.subscribe(channel)
// After
await cable.subscribe(channel).ensureSubscribed()
Similarly, cable.subscribeTo(...)
is not longer async and returns the channel instance immediately. You can call channel.ensureSubscribed()
to make sure the channel has been connected to the server.
The channel.disconnect()
function is no longer async and has not return value. It records the intention to unsubscribe. The actual unsubscribe
command is sent asynchrounously (if requried, i.e., if there are no other channel instances with the same identifier).
channelsCache
is removed since it's no longer needed (and can bring more confusion than value).
Released libraries
@anycable/core
: 0.5.0@anycable/web
: 0.5.0@anycable/turbo-stream
: 0.2.0@anycable/msgpack-encoder
: 0.2.0@anycable/protobuf-encoder
: 0.2.0