Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use memory for storage? #179

Closed
bminer opened this issue Jan 14, 2025 · 2 comments
Closed

Use memory for storage? #179

bminer opened this issue Jan 14, 2025 · 2 comments
Assignees
Labels

Comments

@bminer
Copy link

bminer commented Jan 14, 2025

It would be cool if an option existed to use memory to store the router state, as a substitute for history.pushState. Any ideas for how this could be accomplished? I'm happy to submit a PR if you think this is worthwhile.

@GianlucaGuarini GianlucaGuarini self-assigned this Jan 15, 2025
@GianlucaGuarini
Copy link
Member

That can be handled by using the router stream.
For example:

import { router } from '@riotjs/route'

router.on.value(cacheTheRoutes)

The router object is an erre sream so you should be able to hook your callbacks using the erre API

@bminer
Copy link
Author

bminer commented Jan 25, 2025

Agreed, but how do you tell the Riot components to use that instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants