Giter Site home page Giter Site logo

Comments (2)

arkivanov avatar arkivanov commented on May 31, 2024

Thank you for the request for API improvements, such requests are very valuable. I have considered the concern and decided to keep this API as it is.

Rationale: the back button handling is applicable not only for Android, but for other platform as well. E.g. there are TVs, watches, kiosks with hardware buttons, embedded devices, etc. I understand that this feature is rarely used outside of Android, but still there are possible cases.

Here is additional background. BackPressedDispatcher is already moved to the separate back-pressed module of the Essenty library. The main decompose module depends as api on the back-pressed module.

Why decompose depends on back-pressed? Because the Router controls child component's BackPressedHandlers. Without this dependency, clients will have to pass BackPressedHandler manually via constructors. And what is more important, they will have to manage child BackPressedHandlers manually. When a child component is destroyed, all references to its personal BackPressedHandler should be released, to avoid memory leaks.

Why back-pressed is api dependency? BackPressedHandler is part of the public API, e.g. it is exposed from ComponentContext as a property. So this dependency is for convenience, for clients to use the public API smoothly.

from decompose.

AzimMuradov avatar AzimMuradov commented on May 31, 2024

Thanks for the detailed answer!

from decompose.

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.