0.121.0 • Published 6 years ago

reflector-client v0.121.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

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