GithubHelp home page GithubHelp logo

Comments (6)

madmax983 avatar madmax983 commented on June 19, 2024 1

I think this way is fine. This way implementors don't have to worry about it, the service component cleans itself up.

And it would take some finagling to do it any other way, I think this is the simplest path.

I also managed to clean up another performance issue (the try catch in the connect method. I'm sure I had a reason to do it that way when I first wrote it, but it's unnecessary).

I also fixed another bug when there was no name specified

from lightning-redux.

maniax89 avatar maniax89 commented on June 19, 2024

i posted what I think might be a solution in #18

from lightning-redux.

madmax983 avatar madmax983 commented on June 19, 2024

When this came in last night, I was hoping it would be as simple as throwing a handler on the destroy. Solution makes total sense to me. Only thing I am wary of is that components getting destroyed in LEX doesn't always happen right away. But this will at least ensure that when the redux service component is destroyed, that listener is removed.

from lightning-redux.

maniax89 avatar maniax89 commented on June 19, 2024

To be honest I looked at doing the same (adding event listener to the target component) but I couldn't figure out how to get it to fire. Seems to work for custom events but not for system events like destroy and init.

If you have more insight into the aura framework let me know as it would techincally be more correct to unsubscribe when the target component is destroyed rather than when the redux component is destroyed.

from lightning-redux.

madmax983 avatar madmax983 commented on June 19, 2024

Thanks for the PR!

from lightning-redux.

maniax89 avatar maniax89 commented on June 19, 2024

thanks so much! very quick turnaround on this! everything is working great now

from lightning-redux.

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.