Skip to content

📬 Easy-to-use messaging between iframes and their parent

License

Notifications You must be signed in to change notification settings

nexxtmove/clifton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📬 Clifton

Pat Clifton

Never miss a delivery between your iframes again! Clifton is your friendly neighborhood postman, ensuring your messages arrive safe and sound, no matter the weather.

Install

📦 Get on the road by installing clifton:

npm install clifton

Usage

🚚 Create a Bus on all your pages:

import { Bus } from 'clifton'

const bus = new Bus('letters')

📨 Then start delivering messages:

parent.html iframe.html
bus.deliver('letter', { to: 'Jess' })

bus.receive('reply', msg => {})
bus.receive('letter', msg => {
  bus.deliver('reply', { text: 'Meow' })
})