Comments (4)
Can't you dispatch that DeleteStakeholderAction at the end of the EffectMethod that handles CheckStakeholderAction?
If you need to distinguish if you're "CheckStakeholderAction" for deletion purpose, add a boolean property to the action so the effect knows if it needs to dispatch DeleteStakeholderAction or not.
This is the way Flux/Redux works. I suggest you to study that deeper and get more comfortable with the concepts.
from fluxor.
I'm not understanding your problem, add an example please.
from fluxor.
So for example in this code I am using the first Dispatcher to check if a Stakeholder exists, and it has an effect that sets the StakeholderExists to true. But that effect is executed asynchronously, which results in the StakeholderExists to retain its value false, and the DeleteStakeholderAction therefore never being fired.
Dispatcher.Dispatch(new CheckStakeholderAction(stakeholder));
if (StakeholderState.Value.StakeholderExists)
{
Dispatcher.Dispatch(new DeleteStakeholderAction(stakeholder));
}
I can solve this by using a the bool IsLoading and a while loop like so:
Dispatcher.Dispatch(new CheckStakeholderAction(stakeholder));
while(StakeholderState.Value.IsLoading){
//Do Nothing
}
if (StakeholderState.Value.StakeholderExists)
{
Dispatcher.Dispatch(new DeleteStakeholderAction(stakeholder));
}
But It would be nice if I could instead await the HandleAsync method in my effect somehow.
from fluxor.
Okay thank you, I will look into Redux more, and try what you propose here. 👍
from fluxor.
Related Issues (20)
- Fluxor dont work with new template .Net 8 and InteractiveServerRenderMode HOT 2
- Fluxor breaks ErrorBoundary in Blazor Wasm HOT 2
- Fluxor Redux Dev Tools eating ram HOT 5
- Fluxor.Blazor.Web.ReduxDevTools requires script-src 'unsafe-eval' on CSP HOT 1
- Subscribing external events HOT 2
- Blazor server app in used Redux(Fluxor) in asp .net core error Unable to resolve service for type 'Fluxor.IFeature` while attempting to activate 'Fluxor.State` HOT 2
- Dispatch from Polly HOT 4
- Dispatching action in effect - running orders HOT 1
- Fluxor does not seem to work with the new .NET 8 Blazor Web App template HOT 2
- Deadlock when dispatching from store/feature events HOT 3
- Reducer not getting invoked in .NET 8 Blazor HOT 4
- Test case for dispatcher failure in .NET8 with new render modes HOT 6
- 🤑 Add a sponsor button
- Fluxor not updating UI after state change HOT 4
- Getting DisposableCallback after app has been running for a while HOT 5
- .NET MAUI Hybrid App Demo HOT 2
- Enabling Fluxor for lazy-loaded assemblies HOT 3
- Blazor dot net 8 server interactive component does not re-render when state changes via redux tools time travel HOT 1
- GoAction using relative path doesn't work anymore (LocationChangeException) HOT 2
- Can't Upgrade to v6.0.0 HOT 4
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 fluxor.