leptos-tiptap icon indicating copy to clipboard operation
leptos-tiptap copied to clipboard

Content is pushed back to WASM on every change

Open lpotthast opened this issue 1 year ago • 0 comments

Problem: On every interaction with the instance, the updated content is pushed back to WASM. Making it easy to work with the instance, but incurring significant unnecessary overhead if intermediate states of the tiptap-instances content are never really needed by the user application.

Change: Let users of the TiptapInstance component specify how often they want to receive updated content.

Add three variants:

  • Always : Current behaviour, setter function is called for every change
  • Debounce(delay) : Setter function is only called for states after a change occurred and no other change occurred in 'delay' time
  • Never : Setter is never automatically called. User must ask for either HTML or JSON data explicitly using an event.

Note: The behaviour of the Never and Debounce variants is most likely different to all other 'input' components, where data is given back on every change instantly.

lpotthast avatar Jul 01 '23 10:07 lpotthast