Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 685 Bytes

File metadata and controls

25 lines (16 loc) · 685 Bytes

@ohos-rs/abort-controller

AbortController for OpenHarmony based on emitter.

The bulk of the code in this project is derived from node-abort-controller, with certain alterations made to suit the features of HarmonyOS.

Platform API Version

Install

ohpm install @ohos-rs/abort-controller

Usage

const controller = new AbortController();

asyncFib(20, controller.signal).catch((e: ESObject) => {
    console.error(e) // Error: AbortError
})

controller.abort()