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

refactor(callOrUse): spare a function creation #51

Merged
merged 1 commit into from
Jan 26, 2017

Conversation

matthieuprat
Copy link
Collaborator

@matthieuprat matthieuprat commented Jan 26, 2017

For our purpose, it's useless to return a function from callOrUse.
Additionally, with the current implementation, the "callOrUse" name is a
bit confusing because callOrUse doesn't call nor use the provided
function or object. It just wraps it in a function.

I was initially thinking of renaming this helper to something like
wrap but I figured we do not actually need to "wrap" anything.

So, let's stick with the "callOrUse" name and indeed call or use
the provided function or object.

For our purpose, it's useless to return a function from `callOrUse`.
Additionally, with the current implementation, the "callOrUse" name is a
bit confusing because `callOrUse` doesn't call nor use the provided
function or object. It just wraps it in a function.

I was initially thinking of renaming this helper to something like
`wrap` but I figured we do not actually need to "wrap" anything.

So, let's stick with the "callOrUse" name and indeed call or use
the provided function or object.
@matthieuprat
Copy link
Collaborator Author

Also, with this implementation, I guess callOrUse is more likely to be inlined FWIW.

@gregberge gregberge merged commit 790fe2b into master Jan 26, 2017
@gregberge gregberge deleted the improve-callOrUse branch January 26, 2017 21:08
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 this pull request may close these issues.

None yet

2 participants