monocules.ws-client

1.1.0 • Public • Published
import WS from 'monocules.ws-client'
 
WS
    .connect('my-connect-name', {
        url     : 'localhost:3000',
        options : {
            ...
        }
    })
    .then(
        success => {
            let pub1 = WS.publish('my-connect-name', {...});
 
            pub1.then(
                success => { ... },
                error => { ... }
            )
 
            let pub2 = WS.publish('my-connect-name.my-namespace', {...}); // Namespace
 
            pub2.then(
                success => { ... },
                error => { ... }
            )
        },
        error => {
            console.log(error);
        }
    );

Installation

$ npm install monocules.ws-client

/monocules.ws-client/

    Package Sidebar

    Install

    npm i monocules.ws-client

    Weekly Downloads

    4

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • lamo2k123