This code compiles. I need help with making it more elegant via let###.
{ model;
inject = fun x ->
Effect.bind (inject x) ~f:(fun _ -> Effect.return @@ after x )
}
Code Context
type t = { model : Model.t; inject : Action.t list -> unit Effect.t }
after: Action.t list -> ()
Informal Context
I’m using Bonsai. I’m trying to allow the component constructor to take an extra argument (after: Action.t list -> () to be run after every inject call.
Let actions: Action.t list
So we now have something where I need to compile (inject actions) with (after actions).