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

Add type-safe invoke higher-order function #75

Closed
ignatiusmb opened this issue Feb 17, 2022 · 1 comment
Closed

Add type-safe invoke higher-order function #75

ignatiusmb opened this issue Feb 17, 2022 · 1 comment

Comments

@ignatiusmb
Copy link
Member

invoke will receive an arbitrary amount of functions and/or tuple of function and its arguments, as its (invoke) argument and will return nothing

example usage should be

declare function close(): void;
declare function sort(arr: any[]): void;
const data = [3, 4, 2, 4, 8, 9, 1];

declare function complicated(a: any, b: any, c: any): void;

invoke(close, [sort, data], () => data.push(100), [complicated, { hi: 'mom' }, { hello: 'world' }, ['docs']]);

is this overcomplicating stuff? honestly it looks kinda wack when mixed with some imperative style and lots of arguments, but I think it should make sense when it's done with #74

@ignatiusmb
Copy link
Member Author

Yes, it is

@ignatiusmb ignatiusmb closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2024
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 a pull request may close this issue.

1 participant