( thingId: Id, thing: ThingsByOffset[Offset], offset: Offset, )
| 101 | }; |
| 102 | |
| 103 | export const useProvideThing = <Offset extends Offsets>( |
| 104 | thingId: Id, |
| 105 | thing: ThingsByOffset[Offset], |
| 106 | offset: Offset, |
| 107 | ): void => { |
| 108 | const {16: addExtraThingById, 17: delExtraThingById} = useContext(Context); |
| 109 | useEffect(() => { |
| 110 | addExtraThingById?.(offset, thingId, thing); |
| 111 | return () => delExtraThingById?.(offset, thingId); |
| 112 | }, [addExtraThingById, thingId, thing, offset, delExtraThingById]); |
| 113 | }; |
| 114 | |
| 115 | export const useThingIds = (offset: Offsets): Ids => |
| 116 | objIds((useContext(Context)[offset * 2 + 1] ?? {}) as IdObj<unknown>); |
no test coverage detected
searching dependent graphs…