( state: HookRegistryState, hookId: string | undefined, eventId: string, )
| 786 | } |
| 787 | |
| 788 | function attachEventToHook( |
| 789 | state: HookRegistryState, |
| 790 | hookId: string | undefined, |
| 791 | eventId: string, |
| 792 | ): void { |
| 793 | if (!hookId) return |
| 794 | const hook = state.hooks[hookId] |
| 795 | if (!hook || hook.eventIds.includes(eventId)) return |
| 796 | hook.eventIds.push(eventId) |
| 797 | } |
| 798 | |
| 799 | function inferLifecycleFromSnapshot( |
| 800 | state: Record<string, unknown>, |