Skip to content

Commit c63dad2

Browse files
committed
Rename to Replace.
1 parent eaeab22 commit c63dad2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

abort/abort.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ func Handler[V, E any]() AbortHn[V, E] {
3131
})
3232
succeeded := fx.Map(handler(eff), success[V, E])
3333
failed := func() fx.FxPure[Result[V, E]] { return fx.Pure(&err) }
34-
return fx.Restart(succeeded, failed)
34+
return fx.Replace(succeeded, failed)
3535
}
3636
}

fx.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ func Halt[S, V any]() Fx[S, V] {
4949
return nil
5050
}
5151

52-
// Continues with y if x is already Halted. Otherwise x continues.
53-
func Restart[S, V any](x Fx[S, V], y func() Fx[S, V]) Fx[S, V] {
52+
// Replace x with y if x is already Halted. Otherwise x continues.
53+
func Replace[S, V any](x Fx[S, V], y func() Fx[S, V]) Fx[S, V] {
5454
if x == nil {
5555
return y()
5656
}
@@ -60,7 +60,7 @@ func Restart[S, V any](x Fx[S, V], y func() Fx[S, V]) Fx[S, V] {
6060
}
6161
return func() (immediate[V], suspended[S, V]) {
6262
return nil, func(s *S) Fx[S, V] {
63-
return Restart(sus(s), y)
63+
return Replace(sus(s), y)
6464
}
6565
}
6666
}

0 commit comments

Comments
 (0)