Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native iterators instead of Lumino iterators #346

Merged
merged 62 commits into from
Aug 17, 2022
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8639b66
Refactor some of the public API for iterators
afshin Aug 10, 2022
a935f6a
More iterator refactoring
afshin Aug 10, 2022
029bcc3
Update each<T>() function
afshin Aug 10, 2022
c88f20b
Remove ArrayIterator<T>
afshin Aug 10, 2022
f5176d6
Remove KeyIterator, ValueIterator<T>, ItemIterator<T>, and FnIterator<T>
afshin Aug 10, 2022
150738a
Remove zip<T>() and ZipIterator<T>
afshin Aug 10, 2022
ddeab32
Remove take<T>() and TakeIterator<T>
afshin Aug 10, 2022
ebc44cc
Remove toArray<T>()
afshin Aug 10, 2022
d40cc10
Remove ChainIterator<T> and reimplement chain<T>() with native iterators
afshin Aug 10, 2022
77a44ae
Remove RepeatIterator<T> and reimplement repeat<T>() and once<T>() wi…
afshin Aug 11, 2022
d1b6e2e
Reimplement take<T>() with native iterators
afshin Aug 11, 2022
4c13c6f
Reimplment zip<T>() with native iterators
afshin Aug 11, 2022
588e666
Reimplment stride<T>() with native iterators
afshin Aug 11, 2022
346cd2a
Update topologicSort<T>() to accept native iterable
afshin Aug 11, 2022
de3de59
Reimplment retro<T>() with native iterators
afshin Aug 11, 2022
acaa6ed
Update reduce() to use native iterables
afshin Aug 11, 2022
fb48177
Reimplment range() with native iterators
afshin Aug 11, 2022
e6964f3
Reimplement empty() with native iterators
afshin Aug 11, 2022
462f495
Reimplement filter<T>() with native interators
afshin Aug 11, 2022
6abfc62
Reimplement map<T>() with native interators
afshin Aug 11, 2022
298ac8c
Update find(), findIndex(), min(), max(), and minmax() to use native …
afshin Aug 11, 2022
9380340
Reimplement enumerate() with native types
afshin Aug 11, 2022
ccbb647
Fix algorithm package tests
afshin Aug 11, 2022
518079c
Update LinkedList to use native iterators
afshin Aug 11, 2022
481cfb7
Fix LinkedList tests
afshin Aug 11, 2022
82d9b28
Update disposable
afshin Aug 11, 2022
b4c1250
Update widgets to use native iterators
afshin Aug 11, 2022
3ab8cb1
Fix widget tests
afshin Aug 11, 2022
3d633c4
Update data grid to use native iterators
afshin Aug 11, 2022
4f1a5c1
Update API report
afshin Aug 11, 2022
797ea47
Fix doc strings
afshin Aug 11, 2022
fbc612a
Minor tweak of `LinkedList` iterator methods
afshin Aug 13, 2022
720ce2e
Simplify `chain<T>()`
afshin Aug 13, 2022
35d6f40
Simplify `take<T>()`
afshin Aug 13, 2022
050daeb
[Symbol.iterator]() and Array.from() should almost never need invoked
afshin Aug 13, 2022
d6012a4
Third parameter for comparator functions is superfluous when they are…
afshin Aug 13, 2022
0f2ec49
Simplify stride<T>()
afshin Aug 13, 2022
68eb1dd
Re-enable zip() tests
afshin Aug 13, 2022
a5bc2c3
Simplify iterating through selections in data grid.
afshin Aug 13, 2022
f0189cc
Tweak retro<T>() for readability
afshin Aug 13, 2022
8a9574a
Use for...of for minmax<T>()
afshin Aug 14, 2022
fbf1317
Use `IterableIterator` as return type for all generators
afshin Aug 14, 2022
654aef5
Use for...of instead of each() in disposable and update generated API
afshin Aug 15, 2022
14aa4da
Use for...of instead of each() in LinkedList and topologicSort
afshin Aug 15, 2022
eba5225
Use for...of instead of each in signaling
afshin Aug 15, 2022
688cb0f
Use for...of instead of each() in messaging
afshin Aug 15, 2022
ad8e19b
In almost all cases, prefer native for..of or .forEach to Lumino util…
afshin Aug 15, 2022
00e6855
Fix examples
afshin Aug 15, 2022
b9a0b1b
Fine.
afshin Aug 15, 2022
0f747de
Add iteration notes to migration.md
afshin Aug 16, 2022
9caca56
Add test for take() where count=0
afshin Aug 16, 2022
d74f6c2
Remove duplicate repeat() test
afshin Aug 16, 2022
929b6d9
Better label for stride() test
afshin Aug 16, 2022
1fbfcae
Better labels for zip() tests
afshin Aug 16, 2022
bc2b48f
Clean up test labels as per review comments
afshin Aug 16, 2022
84ec11b
Change rangeLength signature back
afshin Aug 16, 2022
1442576
Reimplement toObject() using iterables and toArray() as a deprecated …
afshin Aug 16, 2022
da91b28
Better toObject() test
afshin Aug 16, 2022
c6673e8
Fix logic bug in take() that @vidartf noticed
afshin Aug 16, 2022
071756a
Fix typo
afshin Aug 16, 2022
1197d76
Another .forEach() => for...of
afshin Aug 16, 2022
c340bd6
Update packages/algorithm/src/iter.ts
afshin Aug 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/algorithm/src/iter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
* ```typescript
* import { iter, toArray } from '@lumino/algorithm';
afshin marked this conversation as resolved.
Show resolved Hide resolved
*
* let data = [1, 2, 3, 4, 5, 6];
*
* let stream = iter(data);
* let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();
*
* toArray(stream); // [1, 2, 3, 4, 5, 6];
* ```
Expand Down