docs: update content

This commit is contained in:
Philipp Kühn
2021-06-04 22:58:34 +02:00
parent 592f62ed0e
commit 3e6d3dca1f
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
# forEach
Loop through an array of items.
## Parameters
`items: any[]`
An array of items.
`fn: (item: any, props: CommandProps & { index: number }) => boolean`
A function to do anything with your item.
## Usage
```js
const items = ['foo', 'bar', 'baz']
editor.commands.forEach(items, (item, { commands }) => {
return commands.insertContent(item)
})
```

View File

@@ -157,6 +157,9 @@
- title: focus - title: focus
link: /api/commands/focus link: /api/commands/focus
type: new type: new
- title: forEach
link: /api/commands/for-each
type: new
- title: insertContent - title: insertContent
link: /api/commands/insert-content link: /api/commands/insert-content
- title: insertContentAt - title: insertContentAt