API to store content of editor | local storage & database #2494
mmailaender
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At the moment, I need to fully deal by myself to store and fetch the content of the rich text editor.
What I would like to see is an API layer that exposes functions like
getLocalStorage()
setLocalStorage()
Store and fetch data from local storage. Plate can fully manage this with the option to get extended by the user.
getDatabase()
setDatabase()
Store and fetch data from a database. There are a ton of databases, so this could be a wrapper where every user can add his database calls.
Combined with Plate props to activate
So the user has two scenarios.
Manual saving:
The user needs to add, e.g., a button to call
on:click={setDatabase()}
Auto saving:
Plate is calling
setDatabase()
automatically.If the prop
localStorage
is set to true, the editor is also stored in local storagesetLocalStorage()
If we use localStorage together with the database, we may also need some revalidating mechanism to stay in sync with the database.
Beta Was this translation helpful? Give feedback.
All reactions