Skip to content

Commit

Permalink
feat: Switch to @cfware/callback-array-once.
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell committed Mar 22, 2019
1 parent 8fa35b0 commit ea84cf2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
8 changes: 0 additions & 8 deletions babel.config.js

This file was deleted.

6 changes: 3 additions & 3 deletions before-install-prompt.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import runCallbacks from '@cfware/callback-array-once';

let done, deferredPrompt; // eslint-disable-line one-var
const notifyFns = [];

window.addEventListener('beforeinstallprompt', event => {
event.preventDefault();
deferredPrompt = event;
done = true;
notifyFns.forEach(fn => {
fn();
});
runCallbacks(notifyFns);
});

export const watch = fn => {
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"url": "https://github.com/cfware/before-install-prompt/issues"
},
"homepage": "https://github.com/cfware/before-install-prompt#readme",
"dependencies": {
"@cfware/callback-array-once": "^1.0.0"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.2.0",
"@babel/register": "^7.0.0",
"@cfware/eslint-config-browser": "^0.2.0",
"@istanbuljs/nyc-config-babel": "^2.0.1",
"ava": "^1.3.1",
"babel-plugin-istanbul": "^5.1.1",
"esm": "^3.2.20",
"nyc": "^13.3.0",
"standard-version": "^5.0.2",
"xo": "^0.24.0"
Expand All @@ -46,7 +46,9 @@
"statements": 100,
"functions": 100,
"branches": 100,
"extends": "@istanbuljs/nyc-config-babel"
"require": [
"esm"
]
},
"xo": {
"overrides": [
Expand Down

0 comments on commit ea84cf2

Please sign in to comment.