drovoo-app-socket-connection-library
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

drovoo-app-socket-connection-library

drovoo-app-socket-connection-libraryDrovoo App, Socket Connection Library

NPM JavaScript Style Guide

Install

npm install --save drovoo-app-socket-connection-library

Usage

import React, { Component } from 'react'

import MyComponent from 'drovoo-app-socket-connection-library'
import 'drovoo-app-socket-connection-library/dist/index.css'

class Example extends Component {
  render() {
    return <MyComponent />
  }
}

License

MIT © corupta

To-Do Notes

  • subscribe/notify for state
  • private _state, private _setState, private _notify in socket, public subscribe
  • useSocket to get socket, useSocketState (via subscribe) to get state
  • withSocket(mapStateToProps, mapSocketToProps)(Component)
  • autoConnect if token is present on Provider
  • setToken when token on Provider changes
  • setToken externally via public setToken
  • when token => undefined, disconnect
  • when token => xxx, connect

Readme

Keywords

none

Package Sidebar

Install

npm i drovoo-app-socket-connection-library

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

235 kB

Total Files

27

Last publish

Collaborators

  • corupta