From 178049922f0fb775703f3b4b8dfac53da51a5f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 27 Mar 2018 21:14:34 +0200 Subject: [PATCH] simplify the Flow type of getAccountById --- src/reducers/accounts.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/reducers/accounts.js b/src/reducers/accounts.js index affb64fe..2a6bcb38 100644 --- a/src/reducers/accounts.js +++ b/src/reducers/accounts.js @@ -81,9 +81,8 @@ export function getVisibleAccounts(state: { accounts: AccountsState }): Account[ return getAccounts(state).filter(account => account.archived !== true) } -export function getAccountById(state: { accounts: AccountsState }, id: string): Account | null { - const account = getAccounts(state).find(account => account.id === id) - return account || null +export function getAccountById(state: { accounts: AccountsState }, id: string): ?Account { + return getAccounts(state).find(account => account.id === id) } export function canCreateAccount(state: State): boolean {