@colisweb/rescript-toolkit 4.18.3 → 4.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -57,18 +57,22 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
|
|
|
57
57
|
),
|
|
58
58
|
},
|
|
59
59
|
({state}) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
addQueryPrefix: true,
|
|
68
|
-
serializeDate: d => d->DateFns.formatWithPattern("yyyy-MM-dd"),
|
|
69
|
-
},
|
|
70
|
-
),
|
|
60
|
+
open Browser
|
|
61
|
+
let search = Location.location->Location.search->Js.String2.sliceToEnd(~from=1)
|
|
62
|
+
let searchParams = URLSearchParams.make(search)
|
|
63
|
+
|
|
64
|
+
searchParams->URLSearchParams.set(
|
|
65
|
+
"start",
|
|
66
|
+
state.timeslot.start->DateFns.formatWithPattern("yyyy-MM-dd"),
|
|
71
67
|
)
|
|
68
|
+
state.selectedDay->Option.forEach(selectedDay => {
|
|
69
|
+
searchParams->URLSearchParams.set(
|
|
70
|
+
"selectedDay",
|
|
71
|
+
selectedDay->DateFns.formatWithPattern("yyyy-MM-dd"),
|
|
72
|
+
)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
RescriptReactRouter.replace("?" ++ searchParams->URLSearchParams.toString())
|
|
72
76
|
None
|
|
73
77
|
},
|
|
74
78
|
)
|
package/src/vendors/Browser.res
CHANGED
|
@@ -105,6 +105,18 @@ module URL = {
|
|
|
105
105
|
external setSearchParams: (t, string, string) => unit = "set"
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
module URLSearchParams = {
|
|
109
|
+
type t
|
|
110
|
+
|
|
111
|
+
@new
|
|
112
|
+
external make: string => t = "URLSearchParams"
|
|
113
|
+
|
|
114
|
+
@send
|
|
115
|
+
external set: (t, string, string) => unit = "set"
|
|
116
|
+
@send
|
|
117
|
+
external toString: (t, unit) => string = "toString"
|
|
118
|
+
}
|
|
119
|
+
|
|
108
120
|
module History = {
|
|
109
121
|
type t
|
|
110
122
|
|
package/src/vendors/Browser.resi
CHANGED
|
@@ -78,6 +78,18 @@ module URL: {
|
|
|
78
78
|
external setSearchParams: (t, string, string) => unit = "set"
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
module URLSearchParams: {
|
|
82
|
+
type t
|
|
83
|
+
|
|
84
|
+
@new
|
|
85
|
+
external make: string => t = "URLSearchParams"
|
|
86
|
+
|
|
87
|
+
@send
|
|
88
|
+
external set: (t, string, string) => unit = "set"
|
|
89
|
+
@send
|
|
90
|
+
external toString: (t, unit) => string = "toString"
|
|
91
|
+
}
|
|
92
|
+
|
|
81
93
|
module History: {
|
|
82
94
|
type t
|
|
83
95
|
|