New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dwmt/loader

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dwmt/loader

Simple loader component for your SPAs

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
increased by180%
Maintainers
3
Weekly downloads
 
Created
Source

@dwmt/loader

Build Status Codacy Badge codecov js-standard-style license standard-readme compliant

Loader is a simple library for easier and more reliable way to handle loading animations. You can easily define loaders globally and handle individual loaders inside front end components or backend signaling.

Table of Contents

Install

npm i @dwmt/loader

Usage

You can define loaders inside a global singleton container and retrieve it from anywhere inside your application

const LC = require('@dwmt/loader')

const globalLoader = LC.registerLoader('globalLoader')
globalLoader.reset()

// API.js

const LC = require('@dwmt/loader')

const loader = LC.getLoader('globalLoader')

const workId = loader.work()

// API slow logic

loader.terminate(workId)

You can also initiate loaders manually withoud the container

const Loader = require('@dwmt/loader/lib/Loader')

const buttonLoader = new Loader()
buttonLoader.onActivation(() => {
  // show loader
})

buttonLoader.onTermination(() => {
  // hide loader
})

const workId = buttonLoader.work()

buttonLoader.terminate(workId)

API

Contributing

See the contributing file!

PRs accepted.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT © dwmt.

Keywords

FAQs

Package last updated on 25 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc