Git Product home page Git Product logo

Comments (4)

leonard-palm avatar leonard-palm commented on July 24, 2024

Hi @TommyVisic,
unfortunately I was not able reproduce the described behaviour. Could you please send an example project where the bug happens? I would be really interested looking into that behaviour.

Setting the onConsumed as a reference or as a lambda definately makes a difference in terms of recomposition. But the library needs to be save to use even with a lambda I think.

Btw: Was the code snippet above just a random example? I think you dont need to trigger this close event via the views state if it is just a direct reaction to a users button click.

from compose-state-events.

TommyVisic avatar TommyVisic commented on July 24, 2024

StateEventExampleApp1.zip

Here's a sample that reproduces the double event. It looks like the key is 1) observe a MutableStateFlow and 2) call navController.popBackstack in the StateEvent action.

Yes, this is pretty much a random example. But in our case, we do indeed involve the view model in the close event because we have to do some work before we want to actually close the screen. Basically it's a "save and close" kind of action.

Thanks for your response!

from compose-state-events.

leonard-palm avatar leonard-palm commented on July 24, 2024

@TommyVisic Thank your for your example project. I was able to reproduce your described behaviour. Looking into it.

from compose-state-events.

leonard-palm avatar leonard-palm commented on July 24, 2024

Fixed in release 2.2.0

from compose-state-events.

Related Issues (5)

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.