12 lines
367 B
TypeScript
12 lines
367 B
TypeScript
|
import { createContext, useContext, type Accessor } from "solid-js";
|
||
|
|
||
|
export type HeroSource = {[key: string | symbol | number]: HTMLElement | undefined}
|
||
|
|
||
|
const HeroSourceContext = createContext<Accessor<HeroSource>>(() => ({}))
|
||
|
|
||
|
export const HeroSourceProvider = HeroSourceContext.Provider
|
||
|
|
||
|
export function useHeroSource() {
|
||
|
return useContext(HeroSourceContext)
|
||
|
}
|