New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ultraq/react-deferred-loader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ultraq/react-deferred-loader

Delay the rendering of a loader animation/component by 1 second

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

react-deferred-loader

Build Status Coverage Status npm Bundlephobia minified size

Delay the rendering of a loader animation/component by 1 second. This is useful for not prematurely putting users into a "passive" state of waiting that a loader normally signals, thus giving the appearance of a faster web application.

Inspired by this talk by Eli Fitch about perceived performance: https://twitter.com/elifitch/status/1047187122229321728

Installation

npm install @ultraq/react-deferred-loader

Usage

The <DeferredLoader> takes a single child function that is passed a boolean value of whether the 1 second has elapsed (true) or not (false), eg:

import DeferredLoader from '@ultraq/react-deferred-loader';

<DeferredLoader>
  {showLoader => showLoader ? (
    /* Render your loading component here */
  ) : null}
</DeferredLoader>

FAQs

Package last updated on 05 Oct 2021

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