1.1.1 • Published 12 months ago

vin-socket.client v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

VIN-SOCKET.CLIENT

Is a websocket client side connection that minified the functionalities and strategies of Websocket for easy implementation of websocket.

This module required to install its peer module vin-socket.server for server side in order to work correctly.

Installation

npm install vin-socket.client

Features

  • Easy to consume
  • Modern approach
  • Background digestion as binary

Usage Examples

Connect to Websocket Server

import {SocketClient} from 'vin-socket.client';

// global scope
const socket = new SocketClient('ws://localhost:3200');

const App: React.FC = () => {

  useEffect(() => {
    socket.onConnect(() => {
      // user has been connected
    })
    socket.emit('my:event', {message: 'Hello World'})
  }, [])

  return (
    <div>HELLO WORLD</div>
  )
}

NOTE: We recommend to put the SocketClient instance in global scope or top of the code

Contributing

Unfortunately we are not accepting any contributors yet this is under probitionary, but for your concerns and possible suggestions just email me at petatemarvin26@gmail.com

Changelog

We're using github release and based on semantic versioning

License

ISC

1.1.1

12 months ago

1.1.0

1 year ago

1.0.14

1 year ago

1.0.11

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.10

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago