Comments (4)
Hey @SilverTab!
One of my primary goals of the library is to make redux performant (hence the ReCombine tagline), so thank you for opening an issue. I think I have the answer you are looking for.
Approaches for Register an Effect
- In the
Store
constructor, as you mentioned (global/permanent Effects) - Using the
register
instance method (local/temporary Effects)
Approach for you
Looks like you may consider option 2, which allows registering/deregistering Effects as you need them. You will define your API-based Effect the same way, but register with register
instead of the Store
constructor.
Documentation
Take a look at the documentation for register
which includes further details on how to maintain the Effect, and an example.
Performance Impacts
Using the register
method would lead to an obvious performance increase, since every dispatched action will not be processed by every Effect, and memory will not be allocated permanently for those Effects.
from recombine.
Ohhh I see, for some reason I thought that the register method was only for Effect that had dispatch
set to false
.
So if I understand what you're saying correctly, Effects that have the potential of affecting multiple parts of the app should probably be global/permanent ones (and registered using the Store constructor), but more local ones (e.g. loading some data from an API and display it in a View, where only that specific View cares about it) should be considered "local/temporary", and be registered using the register
instance method, and will live only as long as the scope of the object that contains them? (model, view model or otherwise)?
from recombine.
You're 100% correct!
I'll try to clarify that part of the Effect Guide.
Feel free to close the issue, and give the repo a star!
from recombine.
You got it! :) Thanks for the clarifications!
from recombine.
Related Issues (9)
- Add State Management Diagram HOT 1
- Add Favicon and Social Meta Tags to Documentation
- Create logo for ReCombine HOT 6
- Support CocoaPods and Carthage
- Add Example App Repos to Docs
- Allow registration of Effects after the creation of the Store
- Split MockStore into a separate package HOT 1
- Add Testing Documentation HOT 1
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 recombine.