Giter VIP home page Giter VIP logo

bloggify-ws's Introduction

bloggify-ws

Version Downloads

Websockets for Bloggify Actions!

☁️ Installation

# Using npm
npm install --save bloggify-ws

# Using yarn
yarn add bloggify-ws

📋 Example

///// Client (browser)
const ws = require("bloggify-ws");

const socket = ws("my-action", (err, data, cb) => {
    if (err) {
        /* The server sent an error */
        /* Or got disconnected (e.g. server down, internet down) */
    }

    /* do something with data coming from the server */
    // ...

    /* Send something back to the server */
    cb(null, {
        foo: "bar"
    })
})

// Send data to the server
socket.data(/* ... */)

// Send an error to the server
socket.error(/* ... */)

///// Server
///// (in `app/actions`)
const action = Bloggify.actions.ws("my-action", (err, data, cb) => {
    if (err) {
        /* The client sent an error */
    }

    /* do something with data coming from the client */
    // ...

    /* Send something back to the client */
    cb(null, {
        foo: "bar"
    })
})

// Send data to the client
action.data(/* ... */)

// Send an error to the client
action.error(/* ... */)

❓ Get Help

There are few ways to get help:

  1. Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
  2. For bug reports and feature requests, open issues. 🐛

😋 How to contribute

Have an idea? Found a bug? See how to contribute.

📜 License

MIT © Bloggify

bloggify-ws's People

Contributors

ionicabizau avatar

Watchers

 avatar  avatar  avatar

bloggify-ws's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.