Browse Source

simplify the Flow type of getAccountById

master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
178049922f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/reducers/accounts.js

5
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 {

Loading…
Cancel
Save