redux-polyglot icon indicating copy to clipboard operation
redux-polyglot copied to clipboard

middleware : catch promise error.

Open guillaumearm opened this issue 9 years ago • 3 comments

performGetPhrases()(see middleware.js in V2 branch) doesn't catch promise error.

guillaumearm avatar Oct 11 '16 23:10 guillaumearm

@JalilArfaoui ? what are we doing when getLocale() or getPhrases() reject a value ?

maybe same as #17 ?

guillaumearm avatar Oct 20 '16 15:10 guillaumearm

IMHO, getLocale() returning a falsy value should have the same effect as a non-corresponding action : nothing happens, we simply return next(action). As for getPhrases(), it should always return something. If empty object, we dispatch SET_LANGAGE with empty phrases. If falsy response anyway, we warn about it and return next(action). What do you think ?

JalilArfaoui avatar Oct 23 '16 17:10 JalilArfaoui

yes, ok for this in #17, but what about rejecting value (promise) ? (see PR #43)

guillaumearm avatar Oct 23 '16 21:10 guillaumearm