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

since `insertFn` is optional, it should be noted as such #7

Closed
ljharb opened this issue Oct 2, 2019 · 2 comments

Comments

@ljharb
Copy link
Member

commented Oct 2, 2019

The signature for this method should be (key, updateFn[, insertFn]) since you're able to omit it.

@bmeck

This comment has been minimized.

Copy link
Member

commented Oct 2, 2019

insertFn isn't optional if you omit updateFn though. It's a bit odd. Since you need at least 1 fn insertFN is only optional in light of the value of updateFn and cannot always be omitted.

@ljharb

This comment has been minimized.

Copy link
Member Author

commented Oct 2, 2019

right, but omitting updateFn requires an explicit undefined - so the .length of the function is 2, because 2 arguments are required at minimum. That there's validation performed on the 2nd, and that its value may force a 3rd to be required, is separate.

@bmeck bmeck closed this in 1ae7f85 Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.