Giter Site home page Giter Site logo

sfintercom's Introduction

Written by Software License

SFIntercom

SFIntercom is a client-side library that allow cross-tab communication with same domain. It can broadcast to all listener on a different tab or window, but can't broadcast to other browser instance.

This library was useful for syncronizing message, notification, and other data.

Sample Usage

// First tab
var client1 = new SFIntercom();
client1.on('log', console.log);
client1.on('warn', console.warn);

// Second tab
var client2 = new SFIntercom();
client2.on('log', console.log);
client2.emit('log', 'Hello from second tab'); // Broadcast to all except this tab

// Third tab
var broadcaster = new SFIntercom();
broadcaster.emit('log', "Hello from third tab"); // Broadcast to all
broadcaster.emit('warn', "Hello warn"); // Broadcast to all who listen to 'warn'

Contribution

If you want to help in SFIntercom library, please fork this project and edit on your repository, then make a pull request to here.

Keep the code simple and clear.

License

SFIntercom is under the MIT license. But don't forget to put the a link to this repository.

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.