# editor

Source: https://developers.inkdrop.app/actions/editor

Actions for managing the [editor](https://developers.inkdrop.app/states/editor) app state, including changing, saving, closing, and creating notes, as well as changing the view mode.

---

## Change Action `change(needsUpdatingDate)`

Flag the editing note as changed, indicating it needs to be saved.

- **needsUpdatingDate** (boolean, required)

  Whether the note's `updatedAt` field needs to be updated or not.

### Set the Editor State as 'Changed'

If you manipulated the note data and want the app to save it:

```js
import { actions } from 'inkdrop'
env.store.dispatch(actions.editor.change(true))
```

---

## Save Action `save()`

Save the currently editing note.

> **Warning:**
>
> Do not use this action in your plugin. Use [`core:save-note` command](https://developers.inkdrop.app/guides/list-of-commands#core-save-note) instead.

- **save** (function)

  Saves the editing note.

---

## Close Action `close()`

Close the editing note. The changes in the note will be saved.

---

## Create Action `create()`

Create a new note and open it.

> **Warning:**
>
> Do not use this action in your plugin. Use [`core:new-note` command](https://developers.inkdrop.app/guides/list-of-commands#core-new-note) instead.

---

## Change View Mode Action `changeViewMode(viewMode)`

Change the editor view mode.

> **Warning:**
>
> Do not use this action in your plugin. Use [`view:toggle-preview` command](https://developers.inkdrop.app/guides/list-of-commands#view-toggle-preview) or [`view:toggle-side-by-side`](https://developers.inkdrop.app/guides/list-of-commands#view-toggle-side-by-side) instead.

- **viewMode** (string, required)

  The editor view mode.

---
