framecomms
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

framecomms

Extreme work in progress

Basics of normalized/standardised iframe communication intended to be a lightweight alternative to @krakenjs/zoid

// page

const parentPage = createIframe({
  id: 'my-frame',
  src: '',
  available: {
    parentPageFn: (params) => {
      console.log('called parentPageFn', params)
    },
  },
})

// inside iframe

const insideIframe = connectTo({
  id: 'my-frame',
  available: {
    insideIframeFn: () => {
      console.log('called insideIframeFn')
    },
  },
})

insideIframe.call('parentPageFn', {id: 1})

/framecomms/

    Package Sidebar

    Install

    npm i framecomms

    Weekly Downloads

    47

    Version

    0.0.8

    License

    MIT

    Unpacked Size

    36.7 kB

    Total Files

    26

    Last publish

    Collaborators

    • richie_south