diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/javascript/promise.gleam | 2 | ||||
-rw-r--r-- | src/gleam_javascript_ffi.mjs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gleam/javascript/promise.gleam b/src/gleam/javascript/promise.gleam index 1fa63f3..bcfd494 100644 --- a/src/gleam/javascript/promise.gleam +++ b/src/gleam/javascript/promise.gleam @@ -49,7 +49,7 @@ pub fn rescue(a: Promise(value), b: fn(Dynamic) -> value) -> Promise(value) /// /// This is the equivilent of the `promise.then` JavaScript method. /// -@external(javascript, "../../gleam_javascript_ffi.mjs", "then") +@external(javascript, "../../gleam_javascript_ffi.mjs", "then_await") pub fn await(a: Promise(a), b: fn(a) -> Promise(b)) -> Promise(b) /// Run a function on the value a promise resolves to, after it has resolved. diff --git a/src/gleam_javascript_ffi.mjs b/src/gleam_javascript_ffi.mjs index 7c14c10..fcf6ae6 100644 --- a/src/gleam_javascript_ffi.mjs +++ b/src/gleam_javascript_ffi.mjs @@ -93,7 +93,7 @@ export function resolve(value) { return Promise.resolve(PromiseLayer.wrap(value)); } -export function then(promise, fn) { +export function then_await(promise, fn) { return promise.then((value) => fn(PromiseLayer.unwrap(value))); } @@ -127,7 +127,7 @@ export function set_reference(ref, value) { return previous; } -export function reference_equal(a,b) { +export function reference_equal(a, b) { return a === b } |