( thingId: Id, thing: ThingsByOffset[Offset], offset: Offset, )
| 137 | }; |
| 138 | |
| 139 | export const useProvideThing = <Offset extends Offsets>( |
| 140 | thingId: Id, |
| 141 | thing: ThingsByOffset[Offset], |
| 142 | offset: Offset, |
| 143 | ): void => { |
| 144 | const contextValue = useContext(Context)?.value ?? EMPTY_CONTEXT; |
| 145 | createRenderEffect(() => { |
| 146 | const {16: addExtraThingById, 17: delExtraThingById} = |
| 147 | untrack(contextValue); |
| 148 | addExtraThingById?.(offset, thingId, thing); |
| 149 | onCleanup(() => delExtraThingById?.(offset, thingId)); |
| 150 | }); |
| 151 | }; |
| 152 | |
| 153 | export const useThingIds = (offset: Offsets): Accessor<Ids> => { |
| 154 | const contextValue = useContext(Context)?.value ?? EMPTY_CONTEXT; |
no test coverage detected
searching dependent graphs…