Function
getHandlerForEvent
(
event: DeltaEvent<TRow, TKey>,
config: EffectConfig<TRow, TKey>,
)
Source from the content-addressed store, hash-verified
| 1006 | // --------------------------------------------------------------------------- |
| 1007 | |
| 1008 | function getHandlerForEvent<TRow extends object, TKey extends string | number>( |
| 1009 | event: DeltaEvent<TRow, TKey>, |
| 1010 | config: EffectConfig<TRow, TKey>, |
| 1011 | ): EffectEventHandler<TRow, TKey> | undefined { |
| 1012 | switch (event.type) { |
| 1013 | case `enter`: |
| 1014 | return config.onEnter |
| 1015 | case `exit`: |
| 1016 | return config.onExit |
| 1017 | case `update`: |
| 1018 | return config.onUpdate |
| 1019 | } |
| 1020 | } |
| 1021 | |
| 1022 | /** |
| 1023 | * Accumulate D2 output multiplicities into per-key effect changes. |
Tested by
no test coverage detected