mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
e525e12c3c
* React hook linter * React linting * Simplify config
29 lines
632 B
TypeScript
29 lines
632 B
TypeScript
import { useEffect } from 'preact/hooks';
|
|
import Apple2IO, { slot } from '../apple2io';
|
|
import ThunderClockCard from '../cards/thunderclock';
|
|
|
|
/**
|
|
* ThunderClock component properties.
|
|
*/
|
|
export interface ThunderClockProps {
|
|
io: Apple2IO | undefined;
|
|
slot: slot;
|
|
}
|
|
|
|
/**
|
|
* ThunderClock card component.
|
|
*
|
|
* @param io Apple2IO object
|
|
* @param slot Slot to register card in
|
|
*/
|
|
export const ThunderClock = ({ io, slot }: ThunderClockProps) => {
|
|
useEffect(() => {
|
|
if (io) {
|
|
const clock = new ThunderClockCard();
|
|
io.setSlot(slot, clock);
|
|
}
|
|
}, [io, slot]);
|
|
|
|
return null;
|
|
};
|