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

feat(itemSelection): add support for items getter #27

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Commits on Jun 12, 2024

  1. feat(itemSelection): add support for items getter

    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);
    ```
    43081j committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    5ac08fd View commit details
    Browse the repository at this point in the history