Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

booth

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

booth

Booth provides request-response over socket.io and creates FRP streams from socket.io events

  • 0.10.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56
increased by833.33%
Maintainers
1
Weekly downloads
 
Created
Source

booth

Booth provides request-response over socket.io and creates FRP streams from socket.io events

request-response

server:

Booth(socket_io, endpoint =>
{
	// register request handler (client will do requests)
	endpoint.request.register('ask-server', data =>
	{
		return { some: 'data' } // can be Promise
	})

	// request client (client should `register`)
	endpoint.request('ask-client', { key: 'server' })
	.then(data =>
	{
		// …
	})
})

client:

var client_endpoint = Endpoint(socket_io_client)

// API is symmetric with servers' one
client_endpoint.request('ask-server', { key: 'client' })
.then(data =>
{
	// …
})

client_endpoint.request.register('ask-client', data =>
{
	return { some: 'client-data' }
})

realtime

most is used as FRP.

server:

import most from 'most'

Booth(socket_io, endpoint =>
{
	var feed = most.from([ 1, 2, 3, 4, 5 ])

	// register realtime (push to client)
	endp.realtime.register('from-server', feed)

	// take realtime feed from client
	endpoint.realtime('from-client')
	/* from here `most` API is available: */
	.observe(data =>
	{
		// …
	})
})

client:

var client_endpoint = Endpoint(socket_io_client)

// API is symmetric with servers' one
client_endpoint.realtime('from-server')
.observe(data =>
{
	// …
})

var feed_client = most.from([ 5, 4, 3, 2, 1 ])

client_endpoint.realtime.register('from-client', feed_client)

license

ISC, copyright © 2017, Strider.

FAQs

Package last updated on 07 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc