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

setData on locations, verify for nested navigation graphs #18

Open
erdo opened this issue Apr 28, 2024 · 0 comments
Open

setData on locations, verify for nested navigation graphs #18

erdo opened this issue Apr 28, 2024 · 0 comments
Labels

Comments

@erdo
Copy link
Owner

erdo commented Apr 28, 2024

  1. This already works for linear navigation graphs (see NavigationModelLinearNavTest and the tests that refer to setData), but we need to verify the behaviour for nested navigation graphs, there are some commented out tests in NavigationModelNestedNavTest but they'll need to be re-written.

  2. Consider changing the advice about using plain Strings to identify locations... you still can, but when we send data to locations, the data needs to be kept as part of the location class itself eg:

    @Serializable
    data class ProductPage(val productId: Int) : Location()

If you used plain Strings to identify your locations eg:

    "ProductPage"

You'd need to implement some custom protocal to handle data for example "{locationName}|{data}" eg:

    "ProductPage|123"

And your UI code would have to parse that (rather than just doing location.productId)


...OK I've considered it 😬 let's just mention that in the docs where we say you can use String to identify locations and gently encourage people not to do that unless they understand the implication and have some good reason, can link them to this issue

@erdo erdo added the code label Apr 28, 2024
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

1 participant