(
thingOffset: Offset,
id: Id,
thing: ThingsByOffset[Offset],
)
| 55 | ); |
| 56 | |
| 57 | const addExtraThingById = <Offset extends Offsets>( |
| 58 | thingOffset: Offset, |
| 59 | id: Id, |
| 60 | thing: ThingsByOffset[Offset], |
| 61 | ): void => { |
| 62 | setExtraThingsById((extraThingsById) => |
| 63 | objGet( |
| 64 | extraThingsById[thingOffset] as IdObj<ThingsByOffset[Offset]>, |
| 65 | id, |
| 66 | ) == thing |
| 67 | ? extraThingsById |
| 68 | : (arrayWith(extraThingsById, thingOffset, { |
| 69 | ...(extraThingsById[thingOffset] as IdObj<ThingsByOffset[Offset]>), |
| 70 | [id]: thing, |
| 71 | } as ThingsById<ThingsByOffset>[Offset]) as ExtraThingsById), |
| 72 | ); |
| 73 | }; |
| 74 | |
| 75 | const delExtraThingById = (thingOffset: Offsets, id: Id): void => { |
| 76 | setExtraThingsById((extraThingsById) => |
no test coverage detected
searching dependent graphs…