Bubbles
Bubbles
DDeno
Created by Bubbles on 4/29/2025 in #help
Fresh: `toggle` is not a function.
I can't seem to figure out why the function toggle is undefined. I'm passing it like other examples on the internet. button.tsx
interface Props {
toggle: () => void;
}

export function MyButton({ toggle }: Props) {
return (
<button
type="button"
onClick={() => toggle()}
>
Toggle
</button>
);
}
interface Props {
toggle: () => void;
}

export function MyButton({ toggle }: Props) {
return (
<button
type="button"
onClick={() => toggle()}
>
Toggle
</button>
);
}
index.tsx
import { useComputed, useSignal } from "@preact/signals";
import { MyButton } from "../islands/Button.tsx";

export default function LandingPage() {
const isLoggingIn = useSignal(true);
const toggle = () => isLoggingIn.value = !isLoggingIn.value;
const text = useComputed(() => isLoggingIn.value ? "Logging In" : "Register");

return (
<div>
<h1>{text}</h1>
<MyButton toggle={toggle} />
</div>
);
}
import { useComputed, useSignal } from "@preact/signals";
import { MyButton } from "../islands/Button.tsx";

export default function LandingPage() {
const isLoggingIn = useSignal(true);
const toggle = () => isLoggingIn.value = !isLoggingIn.value;
const text = useComputed(() => isLoggingIn.value ? "Logging In" : "Register");

return (
<div>
<h1>{text}</h1>
<MyButton toggle={toggle} />
</div>
);
}
I genuinely cannot figure this out. Any help or clue's are appreciated.
3 replies
DDeno
Created by Bubbles on 1/10/2023 in #help
Rewind streams
So I'm using web streams (byob) for a project but in some cases I need to peek ahead. Is it possible to do this with webstreams? I want to read a static amount of bytes and then rewind by n bytes (between 0 and 4)
2 replies
DDeno
Created by Bubbles on 12/28/2022 in #help
Deno bench json
Does deno bench support json output? I want to visualize some of the output data in graphs but I don't really want to parse the output
2 replies
DDeno
Created by Bubbles on 12/5/2022 in #help
Sharing streams
So I have a small project where I want to use streams. But now I need two different transform streams on the same input
const file = await Deno.open(path);

const processingStream1 = file.pipeThrough(transform1);
for await (const line of processingStream1) console.log(line);


const processingStream2 = file.pipeThrough(transform2);
for await (const line of processingStream2) console.log(line);
const file = await Deno.open(path);

const processingStream1 = file.pipeThrough(transform1);
for await (const line of processingStream1) console.log(line);


const processingStream2 = file.pipeThrough(transform2);
for await (const line of processingStream2) console.log(line);
20 replies
DDeno
Created by Bubbles on 9/28/2022 in #help
Vue 3 and deno
So I'm not much of a web dev myself cuz I don't really like to build websites. But now I've found vue and I'm in love with it. Only drawback is that I need to use node. Does anyone know if it's possible to use vue with deno? And if so what are the current drawbacks?
19 replies