0.2.1 • Published 8 years ago

postling v0.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

js-standard-style

Postling

Remote procedure call system to communicate with iframes.

About

Explicit is better than implicit.

Usage

npm install --save postling

import Postling from 'postling'

const postling = new Postling()

if (Object.keys(postling.methods).length === 0) {
  postling.methods.forEach((method) => {
    postling.methods[method]().then((result) => {
      console.log(`[${method}] - `, result);
    }).catch(::console.error)
  })
}

Features

  • simple RPC interface for postMessage communication
  • promise interface

TODO

  • perhaps keep a (global) queue for the initial invocation instead of fetching them (?)
  • use proper a Proxy object as the support and browser adaption is growing