
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Pure JS, lighweight, asynchronous content loader
npm install --save-dev asyncei
import Asyncei from 'asyncei';
new Asyncei('/path/to/handler/');
<div data-fetch="subpath/to/block"></div>
blockContentLoaded
event, on the load of the a block;allBlocksLoaded
event;When initializing Asyncei
three parameters may be set:
handlerURL
– (required) URL for content loading handler.renderFunction
– Function to handle content rendering.Should take two params: element
– DOM Element, and text
– string of content. Default one is:
(element, text) => {element.innerHTML = text}
queryAttribute
– Attribute to query in search of loadable blocks. Default is data-fetch
.Each block load triggers custom event blockContentLoaded
. Example:
let example = document.getElementById('example-component');
example ? example.addEventListener('blockContentLoaded', () => onExampleLoad()) : null;
If all blocks queried on page are loaded, custom event allBlocksLoaded
is triggered. Example:
document.addEventListener('allBlocksLoaded', () => onAllLoaded());
Find our demo here: preload-demo repository
FAQs
Pure JS, lighweight, asynchronous content loader
The npm package asyncei receives a total of 3 weekly downloads. As such, asyncei popularity was classified as not popular.
We found that asyncei demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.