feat: CDPSession.detach

This commit is contained in:
orion 2023-10-08 13:02:01 -05:00
parent 09e143a8b5
commit f0c0e2a32b
Signed by: orion
GPG Key ID: 6D4165AE4C928719
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,4 @@
import { CDPSession } from 'puppeteer'
/** @type {(_: CDPSession) => () => Promise<void>} */
export const _detach = cdp => () => cdp.detach()

View File

@ -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