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

install-prompt

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

install-prompt

a small library for handling install Banner for Progreww Web Application(PWA)

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

install-prompt npm version Build Status codecov

This is a small library for handling install Banner for Progreww Web Application(PWA).

Dependency

No dependency

Install

yarn add install-prompt

Usage

import InstallPrompt from 'install-prompt';
// initial installPrompt
const installPrompt = new InstallPrompt();

// add 1 count when user do some interactive
installPrompt.addCount();

// check if prompt should popup
installPrompt.checkPrompt();

Real example (React)

  import InstallPrompt from 'install-prompt';
  ...
  componentDidMount() {
    this.installPrompt = new InstallPrompt();
    this.installPrompt.addCount();
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.cid !== this.props.cid) {
      this.installPrompt.addCount().checkPrompt();
    }
  }

Options

  • promptKey: (string) default is 'installPrompt'

  • minimumPrompt: (number) default is 2

e.g,

const installPrompt = new InstallPrompt({
  promptKey: 'custom-localstorage-key',
  minumumPrompt: 5
});

Development

yarn dev

Test

yarn test

Keywords

FAQs

Package last updated on 12 Feb 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