Skip to content

somata/somata-websocket-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

somata-websocket-client

Make Somata service calls and subscriptions from the browser using native WebSocket (which means it works with React Native). Pairs well with somata-websocket-server. Remote calls and subscriptions are returned as Kefir streams.

Installation

npm install somata-websocket-client

Usage

Create a client by providing the connection address. Use client.connected$ to wait until the connection is established.

somata = require('somata-websocket-client')
client = somata('ws://localhost:5555')

client.connected$.onValue ->
    client.remote('hello', 'sayHello').onValue (response) ->
        console.log response

    client.subscribe('announcer', 'announce').onValue (announcement) ->
        console.log announcement

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published