( thingOrThingId: T | Id | undefined, offset: Offsets, )
| 91 | ({...useContext(Context)[offset * 2 + 1]}) as IdObj<UsedThing>; |
| 92 | |
| 93 | export const useThingOrThingById = <T extends Thing>( |
| 94 | thingOrThingId: T | Id | undefined, |
| 95 | offset: Offsets, |
| 96 | ): T | undefined => { |
| 97 | const thing = useThing(thingOrThingId as Id, offset); |
| 98 | return isUndefined(thingOrThingId) || isString(thingOrThingId) |
| 99 | ? (thing as T | undefined) |
| 100 | : (thingOrThingId as T); |
| 101 | }; |
| 102 | |
| 103 | export const useProvideThing = <Offset extends Offsets>( |
| 104 | thingId: Id, |
no test coverage detected
searching dependent graphs…