Skip to content

Commit

Permalink
docs: clarify readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
dxinteractive committed Feb 27, 2022
1 parent def2a75 commit 207df14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions packages/dendriform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 207df14

Please sign in to comment.