alhimik45 / rematch-saga

[Obsolete]
MIT License
6 stars 3 forks source link

Conflict with @rematch/loading #2

Open nganhkhoa opened 5 years ago

nganhkhoa commented 5 years ago

Rematch loading doesn't have effects so module.effects is undefined. And Object.keys(effects) will throw an error.

You can see as I debug in firefox in the picture below.

DeepinScreenshot_20190404021009

I think we should return fast if the given modules doesn't have effects.

nganhkhoa commented 5 years ago

I modified the function and it works. Should I make a pull request?

onModel(model) {
    if (typeof model.effects === 'undefined') return;
    ...
}
nganhkhoa commented 5 years ago

The above patch doesn't let loading change.

I tried with yield delay(5000) but loading is still false.

Edit:

Never mind, this was due to @rematch/loading not working on dispatch({}).

rematch#588

alhimik45 commented 5 years ago

If you will make Pull Request, I'll merge it. But I'm paying your attention that this package is incomplete and not works in most cases of using redux-saga. Dont use it, I think its impossible to completely combine Saga and Rematch approaches.