fixed code smells and added some more tests

This commit is contained in:
Sebastian Sdorra
2018-07-30 15:51:45 +02:00
parent b825de3058
commit cba3fc38e6
6 changed files with 45 additions and 9 deletions

View File

@@ -28,7 +28,10 @@ function extractIdentifierFromPending(action: Action) {
return identifier;
}
export default function reducer(state: Object = {}, action: Action): Object {
export default function reducer(
state: Object = {},
action: Action = { type: "UNKNOWN" }
): Object {
const type = action.type;
if (type.endsWith(PENDING_SUFFIX)) {
const identifier = extractIdentifierFromPending(action);