Tiqa / redux-polyglot

Polyglot.js bindings for Redux
MIT License
58 stars 13 forks source link

middleware : catch promise error. #45

Open guillaumearm opened 7 years ago

guillaumearm commented 7 years ago

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

guillaumearm commented 7 years ago

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

maybe same as #17 ?

JalilArfaoui commented 7 years ago

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 ?

guillaumearm commented 7 years ago

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