Skip to content

Commit 864384a

Browse files
committed
Os_tips: Change the type of 'onclose'
1 parent a688f43 commit 864384a

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
===== 4.0.0 (2021-01-13) =====
2+
* BREAKING CHANGE Os_tips: change the type of 'onclose'
3+
14
===== 2.13.0 (2019-12-20) =====
25
* Os_tips: add unset_tip_seen
36

opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
opam-version: "2.0"
22
name: "ocsigen-start"
3-
version: "3.0.0"
3+
version: "4.0.0"
44
55
maintainer: "[email protected]"
66
synopsis: "An Eliom application skeleton ready to use to build your own application with users, (pre)registration, notifications, etc"

src/os_tips.eliom

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ let%client reset_tips () =
151151
(* Returns a block containing a tip,
152152
if it has not already been seen by the user. *)
153153
let%shared block ?(a = []) ?(recipient = `All)
154-
?(onclose = [%client (fun () -> () : unit -> unit)]) ~name ~content () =
154+
?(onclose = [%client (fun () -> Lwt.return_unit : unit -> unit Lwt.t)])
155+
~name ~content () =
155156
let myid_o = Os_current_user.Opt.get_current_userid () in
156157
match recipient, myid_o with
157158
| `All, _
@@ -164,7 +165,7 @@ let%shared block ?(a = []) ?(recipient = `All)
164165
let box_ref = ref None in
165166
let close : (unit -> unit Lwt.t) Eliom_client_value.t =
166167
[%client (fun () ->
167-
~%onclose ();
168+
let%lwt () = ~%onclose () in
168169
let () = match !(~%box_ref) with
169170
| Some x -> Manip.removeSelf x
170171
| None -> () in
@@ -204,7 +205,7 @@ let%client () = Eliom_client.onchangepage onchangepage_handler
204205
(* Display a tip bubble *)
205206
let%client display_bubble ?(a = [])
206207
?arrow ?top ?left ?right ?bottom ?height ?width
207-
?(parent_node : _ elt option) ?(delay = 0.0) ?(onclose = fun () -> ())
208+
?(parent_node : _ elt option) ?(delay = 0.0) ?(onclose = fun () -> Lwt.return_unit)
208209
~name ~content ()
209210
=
210211
let current_waiter = !waiter in
@@ -214,7 +215,7 @@ let%client display_bubble ?(a = [])
214215
let bec = D.div ~a:[a_class ["os-tip-bec"]] [] in
215216
let box_ref = ref None in
216217
let close = fun () ->
217-
onclose ();
218+
let%lwt () = onclose () in
218219
let () = match !box_ref with
219220
| Some x -> Manip.removeSelf x
220221
| None -> () in
@@ -315,7 +316,7 @@ let%shared bubble
315316
Eliom_client_value.t)
316317
() =
317318
let delay : float option = delay in
318-
let onclose : (unit -> unit) Eliom_client_value.t option = onclose in
319+
let onclose : (unit -> unit Lwt.t) Eliom_client_value.t option = onclose in
319320
let myid_o = Os_current_user.Opt.get_current_userid () in
320321
match recipient, myid_o with
321322
| `All, _

src/os_tips.eliomi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ val bubble :
5757
?width:int Eliom_client_value.t ->
5858
?parent_node:[< `Body | Html_types.body_content ] Eliom_content.Html.elt ->
5959
?delay:float ->
60-
?onclose:(unit -> unit) Eliom_client_value.t ->
60+
?onclose:(unit -> unit Lwt.t) Eliom_client_value.t ->
6161
name:string ->
6262
content:((unit -> unit Lwt.t)
6363
-> Html_types.div_content Eliom_content.Html.elt list Lwt.t)
@@ -72,7 +72,7 @@ val bubble :
7272
val block :
7373
?a:[< Html_types.div_attrib > `Class ] Eliom_content.Html.D.attrib list ->
7474
?recipient:[> `All | `Connected | `Not_connected ] ->
75-
?onclose:(unit -> unit) Eliom_client_value.t ->
75+
?onclose:(unit -> unit Lwt.t) Eliom_client_value.t ->
7676
name:string ->
7777
content:((unit -> unit Lwt.t) Eliom_client_value.t
7878
-> Html_types.div_content Eliom_content.Html.elt list Lwt.t) ->

0 commit comments

Comments
 (0)