Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

defer-until-online

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

defer-until-online

A decorator for ensuring that function is deferred until the browser is online

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

defer-until-online

This is a decorator that ensures that a function is deferred until the browser is online. It works for asynchronous functions (returning promises).

In my tests I noticed that you get cases where the connection is unstable (on mobile for example) and this may improve the reliability of a web app.

import deferUntilOnline from 'defer-until-online'

const deferUntil = deferUntilOnline({ timeout: 10000 })

const myfunc = deferUntil(() => {...})

const result = await myfunc(...)

The library is ES5 but requires promise polyfill

Keywords

FAQs

Package last updated on 05 Dec 2018

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