Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 5c03fbb

Browse files
authored
Merge pull request #63 from exoego/timers
Overhaul timers module
2 parents 67a175d + 61243cd commit 5c03fbb

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

app/current/src/main/scala/io/scalajs/nodejs/timers/Immediate.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.scalajs.nodejs.timers
22

3+
import com.thoughtworks.enableIf
34
import io.scalajs.nodejs.clearImmediate
45

56
import scala.scalajs.js
@@ -12,6 +13,14 @@ trait Immediate extends js.Object {
1213

1314
def _onImmediate: js.Function = js.native
1415

16+
@enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs12)
17+
def hasRef(): Boolean = js.native
18+
19+
@enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs10)
20+
def ref(): Immediate = js.native
21+
22+
@enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs10)
23+
def unref(): Immediate = js.native
1524
}
1625

1726
/**

app/current/src/main/scala/io/scalajs/nodejs/timers/Timeout.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.scalajs.nodejs.timers
22

3+
import com.thoughtworks.enableIf
34
import io.scalajs.nodejs.clearTimeout
45

56
import scala.scalajs.js
@@ -15,7 +16,14 @@ trait Timeout extends js.Object {
1516
* @return true, if the timeout has already been called
1617
*/
1718
def _called: Boolean = js.native
19+
@enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs12)
20+
def hasRef(): Boolean = js.native
1821

22+
@enableIf(io.scalajs.nodejs.CompilerSwitches.gteNodeJs10)
23+
def refresh(): Timeout = js.native
24+
25+
def ref(): Timeout = js.native
26+
def unref(): Timeout = js.native
1927
}
2028

2129
/**

0 commit comments

Comments
 (0)