Window object (or maybe a mock :D).
Curried function with window
set.
const windowOpen = windowOpenPromise(window);
windowOpen({
url: "https://example.com",
top: 10,
left: 10
})
.then(newWindow => {
newWindow.console.log("This will log in the new window.");
newWindow.addEventListener("beforeunload", _event => {
console.log("This will log when the new window is closed.");
});
})
.catch(_error => {
console.error("This will log if the new window can't be opened.");
});
Promise with new window.
WindowOpenPromise options.
Promised Window.open.
Example
Returns
Curried function with
window
in context.