Skip to content

Commit ac4319e

Browse files
committed
Back to partial eval
1 parent ec06834 commit ac4319e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/React/Halo/Internal/Eval.purs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,16 @@ defaultEval =
100100
-- | Given an `EvalSpec` builder, it will return an eval function.
101101
mkEval ::
102102
forall m action state props.
103-
EvalSpec props state action m ->
104-
Lifecycle props action -> HaloM props state action m Unit
105-
mkEval spec = case _ of
106-
Initialize props -> traverse_ spec.onAction $ spec.onInitialize props
107-
Update old new -> traverse_ spec.onAction $ spec.onUpdate old new
108-
Action action -> spec.onAction action
109-
Finalize -> traverse_ spec.onAction spec.onFinalize
103+
(EvalSpec props state action m -> EvalSpec props state action m) ->
104+
Lifecycle props action ->
105+
HaloM props state action m Unit
106+
mkEval f = case _ of
107+
Initialize props -> traverse_ eval.onAction $ eval.onInitialize props
108+
Update old new -> traverse_ eval.onAction $ eval.onUpdate old new
109+
Action action -> eval.onAction action
110+
Finalize -> traverse_ eval.onAction eval.onFinalize
111+
where
112+
eval = f defaultEval
110113

111114
-- | Simple way to run Aff logic asynchronously, while bringing errors back into Effect.
112115
runAff :: Aff Unit -> Effect Unit

0 commit comments

Comments
 (0)