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

Accept Readonly* arguments #307

Open
mshustov opened this issue Jan 14, 2024 · 0 comments
Open

Accept Readonly* arguments #307

mshustov opened this issue Jan 14, 2024 · 0 comments

Comments

@mshustov
Copy link
Member

mshustov commented Jan 14, 2024

I often use readonly types in the app to ensure immutable data. I have a hard time passing a read-only argument to a Click-Ui component since an immutable type is a subset of a mutable one. I'd suggest refactoring public interfaces to accept readonly types (for example, ReadonlyArray) instead of mutable ones. For example, in Select

defaultValue?: Array<string>;
onSelect?: (value: Array<string>, type?: SelectionType) => void;
value?: Array<string>;

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

No branches or pull requests

1 participant