I'm wondering if there was a more efficient way of doing an upsert operation? This is what I'm doing currently: ```ts const updateNodes = (node: Node) => { setLocalState( "nodes", produce((nodes) => { const nodeIndex = nodes.findIndex((n) => n.id === node.id); if (nodeIndex !== -1) { nodes[nodeIndex] = node; } else { nodes.push(node); } }), ); }; ```