redux-polyglot
redux-polyglot copied to clipboard
middleware : catch promise error.
performGetPhrases()(see middleware.js in V2 branch) doesn't catch promise error.
@JalilArfaoui ? what are we doing when getLocale() or getPhrases() reject a value ?
maybe same as #17 ?
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 ?
yes, ok for this in #17, but what about rejecting value (promise) ? (see PR #43)