BasicBit | Alex
BasicBit | Alex
SSolidJS
Created by BasicBit | Alex on 7/11/2024 in #support
Use `createEffect` in a terminal environment with Deno and TypeScript
Hello everyone! I wrote the following code, but the effect doesn't work. Nothing is shown in the console:
import { createEffect } from "npm:solid-js";
import { createMutable } from "npm:solid-js/store";

const state = createMutable({ count: 0 });

createEffect(() => {
console.log(state.count);
});

setInterval(() => state.count++, 1000);
import { createEffect } from "npm:solid-js";
import { createMutable } from "npm:solid-js/store";

const state = createMutable({ count: 0 });

createEffect(() => {
console.log(state.count);
});

setInterval(() => state.count++, 1000);
But if I use Skypack imports it works:
import { createEffect } from "https://cdn.skypack.dev/solid-js";
import { createMutable } from "https://cdn.skypack.dev/solid-js/store";

// ...
import { createEffect } from "https://cdn.skypack.dev/solid-js";
import { createMutable } from "https://cdn.skypack.dev/solid-js/store";

// ...
But Skypack doesn't provide the TypeScript types. So everything is any and I get the JavaScript experience. Does anyone smarter than me have an idea how to fix this? Thanks for any help! 😄
4 replies
SSolidJS
Created by BasicBit | Alex on 8/22/2023 in #support
Is there something like a replacePathParameters method?
Hello, I'm trying to do something like this with the SolidJS router:
replacePathParameters("/dogs/are/:var1/cats/are/:var2", {
"var1": "good",
"var2": "better",
});
replacePathParameters("/dogs/are/:var1/cats/are/:var2", {
"var1": "good",
"var2": "better",
});
Thanks for any help. 😄
8 replies