Socket
Book a DemoInstallSign in
Socket

async-components

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-components

Async Components

2.1.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

async-components

Async components allows splitting the web into independent components and easily integrate them, asynchronously.

Demo

http://msn0.github.io/async-components

Installation

npm i async-components
# or
bower i async-components

Usage

Include async-components straight after the <body> tag:

<script src="async-components.es5.min.js"></script>

Define components:

<body>
  <div data-component="/header.html" data-event="header-loaded"></div>
  <div data-component="/listing.html" data-event="listing-loaded"></div>
  <div data-component="/footer.html" data-event="footer-loaded"></div>
</body>

Once component is loaded, the corresponding event is emmited. Let's say listing depends on header. Then listing should listen for header-loaded event, e.g.

document.addEventListener('header-loaded', (data) => {
  console.log(data);
});

License

MIT

Keywords

async components

FAQs

Package last updated on 26 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.