How to "reset" the previewer?

Hi,

I was wondering how to “reset” the previewer app? If I navigate to a particular page in my app (and I don’t have a go-back stack available) I can’t seem to return to the first page of my app.

If I rebuild the app then I can get back to the initial state, but I’d rather not do this as it takes quite a long time to rebuild.

Any solution to this?

Many thanks!

Rebuilding is the way to go in this case. Fuse does its best to store the “state” of your preview during live reloads as you change the code, and that’s why a simple refresh doesn’t reset particular state things, like your navigation stack.

To avoid getting stuck on a particular page though, you should avoid using goto() and prefer using push() whenever possible.

If you need to frequently return to “initial state”, that suggests you’re working on a particular component. I would suggest first building the component alone in a separate Fuse project, and then moving it over as a ux:Class. That allows for a much smoother iteration.

Hope this helps!

Sometimes I place in a DEV-menu either as overlay or as Docked-top outside of the navigation accessable on every page. There you can include crusual actions, i.e. goto(‘Home’), console.log(testVar), ClearVar()…

At the end you can either remove it, or make it accessable in a tricky way like an easteregg :wink:

Cheers

Blade

Thanks all. Good suggestions.