SHARE
TWEET

Untitled

a guest Aug 20th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [%%shared
  2.     let filters_form ((r, f) : react_pointer) (model : Model.t) =
  3.       let supplier_dropdown = Lib.get_suppliers model.suppliers in
  4.       ....
  5.  
  6.       ignore [%client
  7.         ((Lwt.async @@ fun () ->
  8.           Js_of_ocaml_lwt.Lwt_js_events.clicks btn @@ fun _ _ ->
  9.           ...
  10.            let visibility = {
  11.              ...
  12.           } in
  13.           Controller.update (Change_visibility visibility) (~%r,~%f);
  14.           Lwt.return_unit)
  15.          :unit)
  16.       ];
  17.  
  18.       div ~a:[a_class ["form-row"; "align-items-end"]] [
  19.         div ~a:[a_class ["form-group"; "col"]] [label [txt "Supplier"]; supplier_dropdown]
  20.       ]
  21.  
  22.     let filters ((r, f) : react_pointer) =
  23.       let get_filters () =
  24.         let all = Eliom_shared.React.S.map [%shared fun x -> [x]] r in
  25.         let rl = Eliom_shared.ReactiveData.RList.from_signal all in
  26.         let rl = Eliom_shared.ReactiveData.RList.map [%shared (filters_form (~%r, ~%f))] rl in
  27.         rl
  28.       in
  29.       Eliom_content.Html.(R.div (get_filters ()))
  30. ]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top