Skip to content

Commit

Permalink
feat(listComponentState): add asArray()
Browse files Browse the repository at this point in the history
affects: @action-land/component
  • Loading branch information
tusharmath committed Sep 25, 2019
1 parent 47cc7e8 commit 548cf38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/component/src/listComponentState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ export class ListComponentState<S> {
has(k: ListKey): boolean {
return this.hashMap.has(k)
}

get asArray(): Array<[ListKey, S]> {
return this.fold(List.empty<[ListKey, S]>(), (S, L, A) => A.prepend([L, S]))
.asArray
}
}

0 comments on commit 548cf38

Please sign in to comment.