Skip to content

basarat/alertOnLeave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

npm install alertonleave --save

Use

import {alertOnLeave} from "alertonleave";

const dispose = alertOnLeave(()=>{
  if (someCondition) {
    return "Are you sure you want to leave?"
  }
});

// When you don't want to check anymore
dispose();

Build with TypeScript 🌹

About

add an alert on leave check 🌹 ❤️

Resources

Stars

Watchers

Forks

Packages

No packages published