-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(itemSelection): add support for items getter (#27)
Sometimes, we need to retrieve the item list dynamically rather than from a constant array we passed at constructor time. This adds support for passing a function as the items array (`() => T[]`). For example: ```ts let items = []; new ItemSelectionController(this, items); // re-assign items. this wouldn't affect the controller previously. it // will still see the original array items = [a, b]; // instead, we can do this: new ItemSelectionController(this, () => items); ```
- Loading branch information
Showing
2 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters