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(option): add support for functional option arguments #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ardnew
Copy link

@ardnew ardnew commented Aug 28, 2024

This adds support for the so-called "Functional Options" pattern to configure menu.Model.

This pattern makes it much easier to add optional configurations without breaking any existing code or external interfaces.

In particular, a handful of Option functions have been added for more control over the embedded list.Model.

@ardnew
Copy link
Author

ardnew commented Sep 2, 2024

This PR adds support to menu.Model for the following features by providing indirect access to the underlying list.Model (from package github.com/charmbracelet/bubbles/list):

These options are intended to be used as lambda functions/closures passed as arguments with the variable-length parameter list of the package's primary constructor New(string, []Choice, *Choice, ...Option) Model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant