From f32ebd35bb9e2bdac28d9de92cfef9d22654e332 Mon Sep 17 00:00:00 2001 From: Eryn Lynn Date: Sat, 28 Sep 2019 23:29:00 -0400 Subject: [PATCH] Add docs warning --- lib/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/README.md b/lib/README.md index 1087283..6538432 100644 --- a/lib/README.md +++ b/lib/README.md @@ -420,6 +420,10 @@ docs: return "some", "values" 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: - name: "..." type: "...any?"