From f0c0e2a32bed8a3e0a1563e54357d642c3ced255 Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Sun, 8 Oct 2023 13:02:01 -0500 Subject: [PATCH] feat: CDPSession.detach --- src/Puppeteer.CDPSession.js | 4 ++++ src/Puppeteer.CDPSession.purs | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/Puppeteer.CDPSession.js create mode 100644 src/Puppeteer.CDPSession.purs diff --git a/src/Puppeteer.CDPSession.js b/src/Puppeteer.CDPSession.js new file mode 100644 index 0000000..b9fbeb2 --- /dev/null +++ b/src/Puppeteer.CDPSession.js @@ -0,0 +1,4 @@ +import { CDPSession } from 'puppeteer' + +/** @type {(_: CDPSession) => () => Promise} */ +export const _detach = cdp => () => cdp.detach() diff --git a/src/Puppeteer.CDPSession.purs b/src/Puppeteer.CDPSession.purs new file mode 100644 index 0000000..440a3ef --- /dev/null +++ b/src/Puppeteer.CDPSession.purs @@ -0,0 +1,14 @@ +module Puppeteer.CDPSession where + +import Prelude + +import Control.Promise (Promise) +import Control.Promise as Promise +import Effect (Effect) +import Effect.Aff (Aff) +import Puppeteer.Base (CDPSession) + +foreign import _detach :: CDPSession -> Effect (Promise Unit) + +detach :: CDPSession -> Aff Unit +detach = Promise.toAffE <<< _detach