Skip to content

Remote procedure call system to communicate with iframes

License

Notifications You must be signed in to change notification settings

autarc/postling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Remote procedure call system to communicate with iframes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published