2024-07-14 20:28:44 +08:00
|
|
|
import { createContext, useContext, type Accessor } from "solid-js";
|
|
|
|
|
2024-08-05 15:33:00 +08:00
|
|
|
export type HeroSource = {
|
|
|
|
[key: string | symbol | number]: HTMLElement | undefined;
|
|
|
|
};
|
2024-07-14 20:28:44 +08:00
|
|
|
|
2024-08-05 15:33:00 +08:00
|
|
|
const HeroSourceContext = createContext<Accessor<HeroSource>>(() => ({}));
|
2024-07-14 20:28:44 +08:00
|
|
|
|
2024-08-05 15:33:00 +08:00
|
|
|
export const HeroSourceProvider = HeroSourceContext.Provider;
|
2024-07-14 20:28:44 +08:00
|
|
|
|
|
|
|
export function useHeroSource() {
|
2024-08-05 15:33:00 +08:00
|
|
|
return useContext(HeroSourceContext);
|
2024-07-14 20:28:44 +08:00
|
|
|
}
|