fresh-with-signals icon indicating copy to clipboard operation
fresh-with-signals copied to clipboard

Signal passing over the routes

Open vorcigernix opened this issue 2 years ago • 0 comments

I think this is more a feature request than an issue. My state (signal) is getting lost when I hit another route (despite both routes importing the same state component). I think this is expected, but is there a way to keep the state across routes? My state looks like a copypaste of cart.ts

import { signal } from "@preact/signals";

export const address = signal<string>("");

and I assign the value in a very simple way:

address.value="test";

I can push the whole code somewhere if you think it should actually work fine.

vorcigernix avatar Sep 13 '22 11:09 vorcigernix