Comments (6)
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.
i posted what I think might be a solution in #18
from lightning-redux.
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.
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.
Thanks for the PR!
from lightning-redux.
thanks so much! very quick turnaround on this! everything is working great now
from lightning-redux.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightning-redux.