This commit is contained in:
2025-10-13 00:24:11 +08:00
parent 32e3248b8c
commit b8c48b9521
37 changed files with 2334 additions and 1427 deletions
@@ -107,6 +107,7 @@
<ol>
<li><strong>Parent ConnectionId Passing</strong>: Child hubs copy parent's function references via connectionId</li>
<li><strong>Frontend ConnectionId Chain</strong>: Components pass connectionId down the hierarchy</li>
<li><strong>Wrapper Function Pattern</strong>: Child hubs should create wrapper functions that dynamically retrieve and invoke parent functions at runtime, rather than directly copying references. This ensures type safety through runtime checking and supports dynamic function updates from the parent.</li>
</ol>
<h2 id="benefits">Benefits</h2>
<ul>
@@ -119,6 +120,7 @@
<ul>
<li>Apply or inherit from DictionaryHub for auto-cleanup</li>
<li>Use meaningful key names (e.g., &ldquo;transformer-getter&rdquo;)</li>
<li>Always setup dictionary functions unconditionally during initialization - put condition checks inside the functions, not around the setup. This ensures child panels can access functions even when parent objects temporarily don't meet the conditions.</li>
</ul>
<h2 id="common-pitfalls">Common Pitfalls</h2>
<ul>