Move HotbarStore to new format

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-03-22 15:50:11 -04:00
1 parent 4caf77aec6
commit acefc037c1
7 files changed
+319 -248

No files matched your search

@@ -14,6 +14,7 @@ interface Iterator<T> extends Iterable<T> {
flatMap<U>(fn: (val: T) => U[]): Iterator<U>;
concat(src2: IterableIterator<T>): Iterator<T>;
join(sep?: string): string;
take(count: number): Iterator<T>;
}
function chain<T>(src: IterableIterator<T>): Iterator<T> {
@@ -26,6 +27,7 @@ function chain<T>(src: IterableIterator<T>): Iterator<T> {
join: (sep) => join(src, sep),
collect: (fn) => fn(src),
concat: (src2) => chain(concat(src, src2)),
take: (count) => chain(take(src, count)),
[Symbol.iterator]: () => src,
};
}