torhovland / blazor-redux

Connecting a Redux state store with Blazor.
Other
481 stars 48 forks source link

Question: Why put async call in the ActionCreator #4

Closed chanan closed 6 years ago

chanan commented 6 years ago

Hi @torhovland

I was wondering about your decision to put an aync call in https://github.com/torhovland/blazor-redux/blob/master/samples/BlazorStandalone/ActionCreators.cs ?

In redux, I would most likely use something like redux-saga to implement an async action. While I understand that adding the concept of sagas might be overkill, do you think there might be another location to place the async calls while keeping ActionCreator pure?

torhovland commented 6 years ago

Hi, @chanan

I have basically followed the pattern of Async Action Creators, as outlined here: https://redux.js.org/advanced/async-actions

I'm interested in looking more into redux-saga and other middleware to see how they would apply to Blazor, so things might change. But for now I think using Async Action Creators is a nice solution.

panesofglass commented 6 years ago

The new System.Threading.Channels might be fun to try.