reflector-client
v0.121.0
Published
A client for the client to client message bus
Downloads
7
Maintainers
Readme
Low level client for the Reflector client to client messaging system
Implements the messaging protocol that supports the Sanity real time presence exprience.
Initializing
import Reflector from '@sanity/reflector-client'
import myConfiguredSanityClient from './myConfiguredSanityClient'
channel = new Reflector(mySanityClient).connect('channelName')
Listening
channel.listen().subscribe(msg => {
console.log(msg) // => {i: <sanity-identity>, m: <message>}
})
Sending
channel.send({'hello': 'sanity!'})