@@ -573,6 +573,23 @@ object HooksTest extends TestSuite {
573
573
protected implicit def hooksExt1 [Ctx , Step <: HooksApi .AbstractStep ](api : HooksApi .Primary [Ctx , Step ]): X_UseEffect_Primary [Ctx , Step ]
574
574
protected implicit def hooksExt2 [Ctx , CtxFn [_], Step <: HooksApi .SubsequentStep [Ctx , CtxFn ]](api : HooksApi .Secondary [Ctx , CtxFn , Step ]): X_UseEffect_Secondary [Ctx , CtxFn , Step ]
575
575
576
+ def testSingle (): Unit = {
577
+ val counter1 = new Counter
578
+ val counter2 = new Counter
579
+ def state () = s " ${counter1.value}: ${counter2.value}"
580
+
581
+ val comp = ScalaFnComponent .withHooks[Unit ]
582
+ .X_useEffect (counter1.incCB.ret(counter2.incCB))
583
+ .X_useEffect (counter1.incCB(101 ))
584
+ .X_useEffect (counter1.incCB.ret(counter2.incCB))
585
+ .render(_ => EmptyVdom )
586
+
587
+ test(comp()) { _ =>
588
+ assertEq(state(), " 103:0" )
589
+ }
590
+ assertEq(state(), " 103:2" )
591
+ }
592
+
576
593
def testConst (): Unit = {
577
594
val counter1 = new Counter
578
595
val counter2 = new Counter
@@ -1292,6 +1309,7 @@ object HooksTest extends TestSuite {
1292
1309
" useDebugValue" - testUseDebugValue()
1293
1310
" useEffect" - {
1294
1311
import UseEffect ._
1312
+ " single" - testSingle()
1295
1313
" const" - testConst()
1296
1314
" constBy" - testConstBy()
1297
1315
" deps" - testWithDeps()
@@ -1302,6 +1320,7 @@ object HooksTest extends TestSuite {
1302
1320
" useForceUpdate" - testUseForceUpdate()
1303
1321
" useLayoutEffect" - {
1304
1322
import UseLayoutEffect ._
1323
+ " single" - testSingle()
1305
1324
" const" - testConst()
1306
1325
" constBy" - testConstBy()
1307
1326
" deps" - testWithDeps()
0 commit comments