Add docs warning

This commit is contained in:
Eryn Lynn 2019-09-28 23:29:00 -04:00
parent bb13a0e2b6
commit f32ebd35bb

View file

@ -420,6 +420,10 @@ docs:
return "some", "values" return "some", "values"
end) end)
``` ```
::: warning
Promises are eager, so if you pass a Promise to `andThenReturn`, it will begin executing before `andThenReturn` is reached in the chain. Likewise, if you pass a Promise created from [[Promise.reject]] into `andThenReturn`, it's possible that this will trigger the unhandled rejection warning. If you need to return a Promise, it's usually best practice to use [[Promise.andThen]].
:::
params: params:
- name: "..." - name: "..."
type: "...any?" type: "...any?"