diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2022-02-07 16:09:14 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2022-02-07 16:15:44 +0100 |
commit | 5d5549c168af51195e66bf67cc5b23382b8c7d52 (patch) | |
tree | 6268ecee9135854b209a5533eeb99540b7955f31 /script.it | |
parent | 58e892fb0159c42740ae92a642f7eb76245950a6 (diff) |
Changed the organisation in the applications
Diffstat (limited to 'script.it')
-rwxr-xr-x | script.it/dune | 1 | ||||
-rwxr-xr-x | script.it/script.ml | 25 | ||||
-rwxr-xr-x | script.it/state.ml | 2 |
3 files changed, 15 insertions, 13 deletions
diff --git a/script.it/dune b/script.it/dune index db5ba3f..ceae76c 100755 --- a/script.it/dune +++ b/script.it/dune @@ -14,6 +14,7 @@ shapes elements blog + application layer worker_messages outline diff --git a/script.it/script.ml b/script.it/script.ml index a1857db..ba6b828 100755 --- a/script.it/script.ml +++ b/script.it/script.ml @@ -392,18 +392,19 @@ let page_main id = (* The first evaluation is the state. Which is the result of all the successives events to the initial state *) let state = - E.select - [ worker_event - ; canva_events - ; tick_event - ; angle_event - ; width_event - ; delete_event - ; export_event - ; parameters.rendering - ] - |> E.map (State.do_action worker timer) - |> Note.S.accum State.init in + Application.run + (State.do_action worker timer) + State.init + (E.select + [ worker_event + ; canva_events + ; tick_event + ; angle_event + ; width_event + ; delete_event + ; export_event + ; parameters.rendering ]) + in (* The seconde evaluation is the canva refresh, which only occurs when the mouse is updated, or on delete events *) diff --git a/script.it/state.ml b/script.it/state.ml index cb5d9ff..77a24a3 100755 --- a/script.it/state.ml +++ b/script.it/state.ml @@ -195,7 +195,7 @@ let longClick mouse_coord state worker = function | _ -> state let do_action - : Brr_webworkers.Worker.t -> Elements.Timer.t -> events -> state -> state + : Brr_webworkers.Worker.t -> Elements.Timer.t -> (events, state) Application.t = fun worker timer event state -> match event, state.mode with | `Point (delay, point), _ -> |