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

Namespace caches and branches with new router IDs #2135

Merged
merged 4 commits into from
Jan 7, 2024
Merged

Namespace caches and branches with new router IDs #2135

merged 4 commits into from
Jan 7, 2024

Conversation

sbihel
Copy link
Contributor

@sbihel sbihel commented Dec 25, 2023

I had another go #1806 and it turned out to be easier than I previously thought to solve naively. But I'm not sure this is an ideal solution, maybe the IDs shouldn't be UUIDs, or maybe the caches should be held by the objects directly.

I'm also finding it hard to add a unit/integration test, so I would welcome a suggestion on this as well.

@gbj
Copy link
Collaborator

gbj commented Dec 30, 2023

Rather than pulling in uuid maybe just a simple static AtomicUsize or something that increments every time you need to get a new router ID?

And rather than nested HashMaps, maybe using a (AtomicUsize, String) as the key of a single HashMap?

@sbihel
Copy link
Contributor Author

sbihel commented Jan 2, 2024

Thank you for the suggestions! Using tuple keys for the hashmap introduced a couple of clones, but I think it's still better

@gbj
Copy link
Collaborator

gbj commented Jan 7, 2024

Looks great, thanks so much!

@gbj gbj merged commit f5bf539 into leptos-rs:main Jan 7, 2024
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants