From e93ca4107906c27a8ddc73a2fed93c3393ab16cc Mon Sep 17 00:00:00 2001 From: xingmingyuan Date: Wed, 17 Oct 2018 17:28:28 +0800 Subject: [PATCH] Issue #24: fix the `make()` API introduction --- README.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eecaa4a..073b8e4 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,23 @@ or clone this repository and copy `qart.min.js` to your project. ```html ``` @@ -50,7 +60,14 @@ const qart = new QArt({ filter: filter, size: 195 }); -document.getElementById('qart').appendChild(qart.make()); + +// directly appending canvas to the document +qart.make(document.getElementById('qart')) + +// using callback +qart.make((canvas) => { + document.getElementById('qart').appendChild(canvas); +}); ``` ### With React