MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / dispatchTaskUpdate

Function dispatchTaskUpdate

src/editor/TaskLinkOverlay.ts:653–675  ·  view source on GitHub ↗
(view: EditorView, taskPath?: string)

Source from the content-addressed store, hash-verified

651
652// Helper function to dispatch task update effects to an editor view
653export function dispatchTaskUpdate(view: EditorView, taskPath?: string): void {
654 // Validate that view is a proper EditorView with dispatch method
655 if (!view || typeof view.dispatch !== "function") {
656 tasknotesLogger.warn("Invalid EditorView passed to dispatchTaskUpdate:", {
657 category: "validation",
658 operation: "invalid-editorview-passed-dispatchtaskupdate",
659 details: { value: view },
660 });
661 return;
662 }
663
664 try {
665 view.dispatch({
666 effects: [taskUpdateEffect.of({ taskPath })],
667 });
668 } catch (error) {
669 tasknotesLogger.error("Error dispatching task update:", {
670 category: "validation",
671 operation: "dispatching-task-update",
672 error: error,
673 });
674 }
675}
676
677// Export the service for use elsewhere
678export { TaskLinkDetectionService };

Callers 3

toDOMMethod · 0.90
initializeServicesLazilyFunction · 0.90

Calls 2

warnMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected