Skip to content

Commit

Permalink
updateBranchesState should use Pick<K> to be consistent with other me…
Browse files Browse the repository at this point in the history
…thods
  • Loading branch information
shiftkey committed Oct 15, 2017
1 parent b5e73f8 commit 62121ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/src/lib/stores/app-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,14 @@ export class AppStore {
})
}

private updateBranchesState(
private updateBranchesState<K extends keyof IBranchesState>(
repository: Repository,
fn: (branchesState: IBranchesState) => IBranchesState
fn: (branchesState: IBranchesState) => Pick<IBranchesState, K>
) {
this.updateRepositoryState(repository, state => {
const branchesState = fn(state.branchesState)
return { branchesState }
const changesState = state.branchesState
const newState = merge(changesState, fn(changesState))
return { branchesState: newState }
})
}

Expand Down

0 comments on commit 62121ba

Please sign in to comment.