From 8072a03f4822c442a0e1d985c28db834a328af06 Mon Sep 17 00:00:00 2001 From: Daniel Naab Date: Fri, 1 Nov 2024 15:04:40 -0500 Subject: [PATCH] Improve pattern builder docs --- packages/forms/src/patterns/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/forms/src/patterns/README.md b/packages/forms/src/patterns/README.md index 56daa04b..25b50e76 100644 --- a/packages/forms/src/patterns/README.md +++ b/packages/forms/src/patterns/README.md @@ -39,11 +39,14 @@ const input: InputPattern = { } ``` +... or patterns may be created with the builder's object-oriented interface: + ```typescript -const input = new InputPatternBuilder(); +const input1 = new InputPatternBuilder(); +const input2 = new InputPatternBuilder(); const page1 = new Page({ title: 'Page 1', patterns: [input1.id] }); -const pageSet = new PageSet({ pages: [page1.id] }, 'page-set'); -const page2 = new Page({ title: 'Page 2', patterns: [input1.id] }); +const pageSet = new PageSet({ pages: [page1.id] }); +const page2 = new Page({ title: 'Page 2', patterns: [input2.id] }); pageSet.addPage(page2) // Construct the pattern objects