3.0.0 • Published 6 years ago

domain-singleton v3.0.0

Weekly downloads
13
License
SEE LICENSE IN LI...
Repository
github
Last release
6 years ago

appoint one page or frame on a domain to handle a task

Usage

var domainSingleton = require('domain-singleton')
var pageBus = require('page-bus')

window.addEventListener('DOMContentLoaded', function () {
  domainSingleton({
    task: 'connect-to-peers',
    bus: pageBus(),
    onAppointed: function () {
      document.body.innerHTML = 'Appointed'
      // ...
    }
  })
})

Bundling Notes

This package uses require('assert') assertions. You may like to remove those statements from production bundles with a tool like unassertify.

This package uses debug to log debugging messages. You can enable logging with localStorage.debug = 'domain-singleton:*' or localStorage.debug = 'domain-singleton:{task}', where task is the string passed as options.task.

Licensing

This package is to free to use in open source under the terms of the License Zero Reciprocal Public License.

Licenses for use in closed and proprietary software are available via licensezero.com.

L0

3.0.0

6 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago