@sanity/reflector-client

2.0.9 • 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 @sanity/reflector-client

Weekly Downloads

1,144

Version

2.0.9

License

MIT

Unpacked Size

8.95 kB

Total Files

6

Last publish

Collaborators

  • drewsanity
  • refiito
  • sergeisarviro
  • ash
  • indrek.karner
  • cngonzalez-sanity
  • rdunk
  • rneatherway-sanity
  • ricokahler
  • pedro-sanity
  • jonabc
  • kenjonespizza
  • pauloborgesf
  • binoy14
  • simen.svale
  • svirs
  • josh_sanity_io
  • joneidejohnsen
  • nina.andal
  • rankers
  • snorreeb
  • mattcraig
  • vincentquigley
  • stipsan
  • michael-sanity
  • rubioz
  • tonina
  • ritasdias
  • simeonsanity
  • kmelve
  • bjoerge
  • rexxars
  • skogsmaskin
  • robinpyon
  • mariuslundgard
  • sanity-io
  • evenw
  • radhe_sanity
  • rbotten
  • judofyr
  • obliadp
  • dcilke
  • fredcarlsen
  • hermanw
  • sgulseth
  • atombender