reflector-client

0.121.0 • Public • Published

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!'})

Package Sidebar

Install

npm i reflector-client

Weekly Downloads

0

Version

0.121.0

License

MIT

Last publish

Collaborators

  • bjoerge