react-hook-popup
Advanced tools
Comparing version 1.1.0-alpha.0 to 1.1.0-alpha.1
@@ -9,6 +9,12 @@ "use strict"; | ||
var _b = react_1.useState(undefined), confirmPromise = _b[0], setConfirmPromise = _b[1]; | ||
react_1.useEffect(function () { | ||
function initializePopup() { | ||
setConfirmPromise(new Promise(function (resolve) { | ||
registerPopup(key, popupRenderer, resolve); | ||
registerPopup(key, popupRenderer, function (val) { | ||
resolve(val); | ||
initializePopup(); | ||
}); | ||
})); | ||
} | ||
react_1.useEffect(function () { | ||
initializePopup(); | ||
return function () { | ||
@@ -15,0 +21,0 @@ unRegisterPopup(key); |
{ | ||
"name": "react-hook-popup", | ||
"version": "1.1.0-alpha.0", | ||
"version": "1.1.0-alpha.1", | ||
"description": "Easily manage popups like alerts and modals in React with a single hook", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/aidanjw1/react-hook-popup#readme", |
Sorry, the diff of this file is not supported yet
44392
950