From 56a19d5c78d2c733d5cdef3bcc626f0608a39d92 Mon Sep 17 00:00:00 2001 From: Nicolas Lepage <19571875+nlepage@users.noreply.github.com> Date: Sun, 12 Jun 2022 23:17:52 +0200 Subject: [PATCH] fix isAsyncIterable type-guard example (#1415) --- website/docs/plugins/lifecycle.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/website/docs/plugins/lifecycle.mdx b/website/docs/plugins/lifecycle.mdx index a4a429648d373..d715c8fe09417 100644 --- a/website/docs/plugins/lifecycle.mdx +++ b/website/docs/plugins/lifecycle.mdx @@ -198,9 +198,8 @@ const myPlugin = (): Plugin => { onExecute({ args }) { return { onExecuteDone: ({ result, setResult }) => { - if (isAsyncIterable(result)) { - // Here you can access result, and modify it with setResult if needed - } + if (!isAsyncIterable(result)) return + // Here you can access result, and modify it with setResult if needed }, }; },