Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@grrr/ready

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grrr/ready

Listener for DOM and document ready and loaded events

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
4
Created
Source

Ready

Build Status

DOM ready & document loaded JavaScript listeners

  • Lightweight (less than 250b minified and gzipped)
  • No dependencies
  • Transpile to desired browser target (syntax only)

Built with ❤️ by GRRR.

Installation

$ npm install @grrr/ready

Note: depending on your setup additional configuration might be needed, since this package is published with untranspiled JavaScript.

Usage

Import into your main JavaScript file:

import { onDocumentLoaded, onDomReady } from '@grrr/ready';

onDomReady(() => {
  // Execute main functions
});

onDocumentLoaded(() => {
  // Execute functions after the document has fully loaded
});

DOM ready

The onDomReady function:

Document loaded

The onDocumentLoaded function:

FAQs

Package last updated on 08 Nov 2019

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