Skip to content

Commit 056ce1c

Browse files
authored
@ocaml.doc -> proper doc comments (#141)
1 parent a59d15d commit 056ce1c

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

src/RescriptReactErrorBoundary.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
@ocaml.doc("
1+
/***
22
* Important note on this module:
33
* As soon as React provides a mechanism for error-catching using functional component,
44
* this is likely to be deprecated and/or move to user space.
5-
")
5+
*/
66
type info = {componentStack: string}
77

88
type params<'error> = {

src/RescriptReactErrorBoundary.resi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
@ocaml.doc("
1+
/***
22
* Important note on this module:
33
* As soon as React provides a mechanism for error-catching using functional component,
44
* this is likely to be deprecated and/or move to user space.
5-
")
5+
*/
66
type info = {componentStack: string}
77

88
type params<'error> = {

src/RescriptReactRouter.resi

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
@ocaml.doc(
2-
"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\")` */
42
let push: string => unit
53

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\")` */
95
let replace: string => unit
106
type watcherID
117
type url = {
@@ -17,15 +13,13 @@ type url = {
1713
search: string,
1814
}
1915

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 */
2317
let watchUrl: (url => unit) => watcherID
2418

25-
@ocaml.doc(" stop watching for URL changes ")
19+
/** stop watching for URL changes */
2620
let unwatchUrl: watcherID => unit
2721

28-
@ocaml.doc("this is marked as \"dangerous\" because you technically shouldn't
22+
/** this is marked as \"dangerous\" because you technically shouldn't
2923
be accessing the URL outside of watchUrl's callback; you'd read a potentially
3024
stale url, instead of the fresh one inside watchUrl.
3125
@@ -37,10 +31,10 @@ let unwatchUrl: watcherID => unit
3731
So, the correct (and idiomatic) usage of this helper is to only use it in
3832
a component that's also subscribed to watchUrl. Please see
3933
https://github.com/reasonml-community/reason-react-example/blob/master/src/todomvc/TodoItem.re
40-
for an example.")
34+
for an example. */
4135
let dangerouslyGetInitialUrl: (~serverUrlString: string=?, unit) => url
4236

43-
@ocaml.doc("hook for watching url changes.
37+
/** hook for watching url changes.
4438
* serverUrl is used for ssr. it allows you to specify the url without relying on browser apis existing/working as expected
45-
")
39+
*/
4640
let useUrl: (~serverUrl: url=?, unit) => url

0 commit comments

Comments
 (0)