You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"update the url with the string path. Example: `push(\"/book/1\")`, `push(\"/books#title\")` "
3
-
)
1
+
/** update the url with the string path. Example: `push(\"/book/1\")`, `push(\"/books#title\")` */
4
2
letpush: string=>unit
5
3
6
-
@ocaml.doc(
7
-
"update the url with the string path. modifies the current history entry instead of creating a new one. Example: `replace(\"/book/1\")`, `replace(\"/books#title\")` "
8
-
)
4
+
/** update the url with the string path. modifies the current history entry instead of creating a new one. Example: `replace(\"/book/1\")`, `replace(\"/books#title\")` */
9
5
letreplace: string=>unit
10
6
typewatcherID
11
7
typeurl= {
@@ -17,15 +13,13 @@ type url = {
17
13
search: string,
18
14
}
19
15
20
-
@ocaml.doc(
21
-
"start watching for URL changes. Returns a subscription token. Upon url change, calls the callback and passes it the url record "
22
-
)
16
+
/** start watching for URL changes. Returns a subscription token. Upon url change, calls the callback and passes it the url record */
23
17
letwatchUrl: (url=>unit) =>watcherID
24
18
25
-
@ocaml.doc(" stop watching for URL changes ")
19
+
/** stop watching for URL changes */
26
20
letunwatchUrl: watcherID=>unit
27
21
28
-
@ocaml.doc("this is marked as \"dangerous\" because you technically shouldn't
22
+
/** this is marked as \"dangerous\" because you technically shouldn't
29
23
be accessing the URL outside of watchUrl's callback; you'd read a potentially
30
24
stale url, instead of the fresh one inside watchUrl.
31
25
@@ -37,10 +31,10 @@ let unwatchUrl: watcherID => unit
37
31
So, the correct (and idiomatic) usage of this helper is to only use it in
38
32
a component that's also subscribed to watchUrl. Please see
0 commit comments