Skip to content

Commit

Permalink
Merge pull request #214 from swiftwasm/katei/expose-hook-points
Browse files Browse the repository at this point in the history
Expose `JavaScriptEventLoop.queueMicrotask` and `.setTimeout`
  • Loading branch information
kateinoigakukun authored Oct 3, 2022
2 parents a549f58 + d0f49ad commit 320282f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {

/// A function that queues a given closure as a microtask into JavaScript event loop.
/// See also: https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
let queueMicrotask: @Sendable (@escaping () -> Void) -> Void
public var queueMicrotask: @Sendable (@escaping () -> Void) -> Void
/// A function that invokes a given closure after a specified number of milliseconds.
let setTimeout: @Sendable (Double, @escaping () -> Void) -> Void
public var setTimeout: @Sendable (Double, @escaping () -> Void) -> Void

/// A mutable state to manage internal job queue
/// Note that this should be guarded atomically when supporting multi-threaded environment.
Expand Down

0 comments on commit 320282f

Please sign in to comment.