43 lines
No EOL
847 B
TypeScript
43 lines
No EOL
847 B
TypeScript
// import { createSignal, onCleanup } from "solid-js";
|
|
import { onCleanup } from "solid-js";
|
|
import { removethething } from "./utils.ts";
|
|
|
|
function HoverComponent() {
|
|
let timerId: number|null;
|
|
|
|
// const [name, setname] = createSignal(true)
|
|
|
|
// const startTimer = () => {
|
|
// timerId = setTimeout(() => {
|
|
// setname(!name())
|
|
// }, 3000);
|
|
// };
|
|
|
|
const clearTimer = () => {
|
|
if (timerId) {
|
|
clearTimeout(timerId);
|
|
timerId = null;
|
|
}
|
|
};
|
|
|
|
// const handleMouseEnter = () => {
|
|
// startTimer();
|
|
// };
|
|
|
|
onCleanup(() => {
|
|
clearTimer();
|
|
});
|
|
|
|
return (
|
|
<h1
|
|
class="removethisinstantly"
|
|
// disabled because uhh uhmm
|
|
onMouseEnter={removethething}
|
|
// onMouseLeave={clearTimer}
|
|
>
|
|
{/* {name() ? "ECHO" : "exhq"} */}
|
|
</h1>
|
|
);
|
|
}
|
|
|
|
export default HoverComponent; |