From 8ff167d3fc3c49206617d79a46bfa9515797309f Mon Sep 17 00:00:00 2001 From: Yifeng Wang Date: Wed, 10 Jan 2018 09:43:12 +0800 Subject: [PATCH] update async demo --- docs/walkthrough.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/walkthrough.md b/docs/walkthrough.md index 2408cc2..cfed4f8 100644 --- a/docs/walkthrough.md +++ b/docs/walkthrough.md @@ -198,9 +198,9 @@ Say you're transforming data of a legacy rich content editor, whose XML string h async function imageOps (node, resolve, reject) { const image = await fetch(node.src) const newSrc = await uploadImage(image) - resolve({ - node: { ...node, src: newSrc } - }) + try { + resolve({ node: { ...node, src: newSrc } }) + } catch (e) { reject(e) } } const rules = [