GithubHelp home page GithubHelp logo

Comments (4)

raamcosta avatar raamcosta commented on June 16, 2024 2

Hi @MichaelOliveiraBx

It works, but when we have more than 40 Destination, it's starting to become difficult to maintain

You can just do

dependency(OpenFullScreen { openFullScreen.invoke() })

And that will make it available to any destination in this DestinationsNavHost, even if you have a thousand. I also like how you're just passing a specific functionality you need rather than passing a whole NavController. I would go with that if possible.

I see the idea with the registry, but I would personally avoid doing this as much as possible, unless it's the only way. But if you have it and it works for you, nothing against it either :)

from compose-destinations.

WildOrangutan avatar WildOrangutan commented on June 16, 2024 1

We're using CompositionLocalProvider to obtain the instance of root DestinationsNavigator.

from compose-destinations.

MichaelOliveiraBx avatar MichaelOliveiraBx commented on June 16, 2024

Yes nice idea, I don’t think about using CompositionLocalProvider enough.
But I think I prefer in this case, to create another DestinationsNavigator and inject it with the dependency builder.
To have it directly in the destination arguments

from compose-destinations.

MichaelOliveiraBx avatar MichaelOliveiraBx commented on June 16, 2024

Hi πŸ‘‹
Yes ok I see, I know that the interface is available in all destination, we can continue to use the dependency but be more smart, I will make an interface to navigate to all full screen destination

fun interface OpenFullScreen {
    fun invoke(destination: Destination)
}

I agree with you, I am not fan to pass whole NavController
Thanks for your feed back :)

from compose-destinations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.