Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Options bag parameter #11

Closed
ghost opened this issue Nov 1, 2020 · 3 comments · Fixed by #25
Closed

Options bag parameter #11

ghost opened this issue Nov 1, 2020 · 3 comments · Fixed by #25

Comments

@ghost
Copy link

ghost commented Nov 1, 2020

How about, instead of the single second parameter, an "option bag" object is used instead for extensibility later?

ex:

function foo(callback) {
    try {
        callback( );
    } catch( cause ) {
        throw new Error( "callback threw an error", { cause } );
    }
}
@legendecas
Copy link
Member

This is duplicated with #10. I'm closing this.

@domenic
Copy link
Member

domenic commented Nov 30, 2020

I think it is not correct to dupe this with #10, since #10's original post is on a different, very large topic.

@legendecas
Copy link
Member

I'm reopening this issue since this is a smaller part of what #10 is intended to achieve. The option bag parameter is a very valuable alternative to the current positional parameter solution.

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

Successfully merging a pull request may close this issue.

2 participants