0.0.10 • Published 5 years ago

good-goodbye v0.0.10

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

good_goodbye

Easy way to determine any beforeunload callbacks do you need.

Installation

Install with yarn:

yarn add good-goodbye
# or npm:
npm i -S good-goodbye

Usage

import GooodGoodbye from 'good-goodbye'

GooodGoodbye.set("testUnload", () => { 
  SomeModule.call("unloadCallback")
})

//To show browser prompt return text or true value
GooodGoodbye.set("testUnload", () => { 
  SomeModule.call("unloadCallback")
  if (SomeModule.hasWarnings()) return "Warning"
  if (SomeModule.unfinished()) return true
})

//Get all callbacks
GooodGoodbye.callbacks // => { testUnload: f }

//Unset callback
GooodGoodbye.unset("testUnload")

//Unset all callbacks
GooodGoodbye.unsetAll()

License

Released under MIT License.

Authors

Created by spaceIess.

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago