From 207df14e4b50a440a6146cfe11b2d90c4a942dc1 Mon Sep 17 00:00:00 2001 From: Damien Clarke Date: Sun, 27 Feb 2022 17:03:38 +1100 Subject: [PATCH] docs: clarify readonly --- README.md | 6 +++--- packages/dendriform/README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 781c365..838d812 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ npm install --save dendriform - [Rendering](#rendering) - [Rendering arrays](#rendering-arrays) - [Setting data](#setting-data) -- [Readonly forms](#readonly-forms) +- [Read-only forms](#readonly-forms) - [Updating from props](#updating-from-props) - [ES6 classes](#es6-classes) - [ES6 maps](#es6-maps) @@ -580,9 +580,9 @@ form.done(); // form.value will update to become 3 ``` -### Readonly forms +### Read-only forms -You may want to allow subscribers to a form, while also preventing them from making any changes. For this use case, the `readonly()` method returns a version of the form that cannot be set and cannot navigate history. Any forms branched off a readonly form will also be unable to set or navigate history. +You may want to allow subscribers to a form, while also preventing them from making any changes. For this use case the `readonly()` method returns a version of the form that cannot be set and cannot navigate history. Calls to `set()`, `setParent()`, `undo()`, `redo()` and `go()` will throw an error. Any forms branched off a readonly form will also be read-only. ```js const form = new Dendriform(0); diff --git a/packages/dendriform/README.md b/packages/dendriform/README.md index 781c365..838d812 100644 --- a/packages/dendriform/README.md +++ b/packages/dendriform/README.md @@ -141,7 +141,7 @@ npm install --save dendriform - [Rendering](#rendering) - [Rendering arrays](#rendering-arrays) - [Setting data](#setting-data) -- [Readonly forms](#readonly-forms) +- [Read-only forms](#readonly-forms) - [Updating from props](#updating-from-props) - [ES6 classes](#es6-classes) - [ES6 maps](#es6-maps) @@ -580,9 +580,9 @@ form.done(); // form.value will update to become 3 ``` -### Readonly forms +### Read-only forms -You may want to allow subscribers to a form, while also preventing them from making any changes. For this use case, the `readonly()` method returns a version of the form that cannot be set and cannot navigate history. Any forms branched off a readonly form will also be unable to set or navigate history. +You may want to allow subscribers to a form, while also preventing them from making any changes. For this use case the `readonly()` method returns a version of the form that cannot be set and cannot navigate history. Calls to `set()`, `setParent()`, `undo()`, `redo()` and `go()` will throw an error. Any forms branched off a readonly form will also be read-only. ```js const form = new Dendriform(0);