Skip to content
Discussion options

You must be logged in to vote

You're on the right track—updating attributes (like word count) so they're available to API calls requires an explicit backend update. Local/frontend changes alone aren't persisted or exposed via the API; you must send the update to the backend, which your use of api.runOnBackend does correctly. This is the recommended approach for persisting attribute changes from frontend scripts in Trilium [source].

Debouncing is not built into Trilium's attribute update flow, but it's a good idea to add it yourself if updates could happen frequently (e.g., on every keystroke). Trilium provides a general-purpose debounce utility in the frontend (debounce.ts), which you can use to wrap your backend upd…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lzinga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant