Miss any of our Open RFC calls?Watch the recordings here! »

@wikia/post-quecast

2.0.1 • Public • Published

Post Quecast

npm version npm downloads Travis Renovate Travis

Travis Travis Travis Travis Travis

Post Quecast - Post Message based Queued Broadcast.

It is callback powered lib for creating semi-distributed communication system between iframes and window instances. The distinct feature of the lib is ability to remember (queue) messages so that it doesn't matter when a communicator is instantiated it will get full message history.

It is heavily inspired by Redux and NgRx and aims to create similar API.

Table of Contents

Installation

To install post-quecast:

npm install @wikia/post-quecast

Usage

The most basic usage is:

// top window that loads first
import { setupPostQuecast } from '@wikia/post-quecast';
 
setupPostQuecast();
// anywhere, including iframes
import { Communicator } from '@wikia/post-quecast';
 
const communicator = new Communicator();
 
communicator.addListener(console.log);
communicator.dispatch({ type: 'action name', ...payload });

More detailed explanation can be found in API section.

More advanced examples on how to integrate PostQuecast with things like RxJs and be found in Addons Section.

Restrictions

  • setupPostQuecast needs to be called before anything else.
  • setupPostQuecast needs to be called on top level window.

Install

npm i @wikia/post-quecast

DownloadsWeekly Downloads

275

Version

2.0.1

License

MIT

Unpacked Size

145 kB

Total Files

55

Last publish

Collaborators

  • avatar