@colisweb/rescript-toolkit 2.29.2 → 2.31.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "2.29.2",
3
+ "version": "2.31.0",
4
4
  "scripts": {
5
5
  "clean": "rescript clean",
6
6
  "build": "rescript build",
@@ -1,8 +1,11 @@
1
1
  let debug: 'a => unit
2
2
  let debug2: ('a, 'b) => unit
3
+ let debugMany: array<string> => unit
3
4
 
4
5
  let warning: 'a => unit
5
6
  let warning2: ('a, 'b) => unit
7
+ let warningMany: array<string> => unit
6
8
 
7
9
  let error: 'a => unit
8
10
  let error2: ('a, 'b) => unit
11
+ let errorMany: array<string> => unit
@@ -1,2 +1,12 @@
1
1
  module UnitMeasure = Toolkit__Utils_UnitMeasure
2
2
  module Regex = Toolkit__Utils_Regex
3
+
4
+ let wait = ms =>
5
+ Js.Promise.make((~resolve, ~reject as _) => {
6
+ Js.Global.setTimeout(() => {
7
+ let data = ()
8
+ resolve(. data)
9
+ }, ms)->ignore
10
+ })
11
+ ->Promise.Js.fromBsPromise
12
+ ->Promise.Js.toResult
@@ -98,12 +98,14 @@ external options: (string, ~config: config=?, unit) => Promise.Js.t<response<'da
98
98
  "options"
99
99
 
100
100
  module Interceptors = {
101
- @module("axios") @scope(("default", "interceptors", "request"))
102
- external requestInterceptor: ('config => Promise.Js.t<'updatedConfig, 'error>) => unit = "use"
101
+ type t
102
+ module Request = {
103
+ @module("axios") @scope(("default", "interceptors", "request"))
104
+ external use: ('config => Promise.Js.t<'updatedConfig, 'error>) => t = "use"
103
105
 
104
- @module("axios") @scope(("default", "interceptors", "response"))
105
- external responseInterceptor: ('response => Promise.Js.t<'updatedResponse, 'error>) => unit =
106
- "use"
106
+ @module("axios") @scope(("default", "interceptors", "request"))
107
+ external eject: t => unit = "eject"
108
+ }
107
109
  }
108
110
 
109
111
  module WithResult = {