Created
July 17, 2019 03:41
-
-
Save qpfiffer/179cd76bdc535fef1578fb384ebf144f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userProfileIsOldEnough = () => { | |
return userProfile.age > 18; | |
} | |
export default { userProfileIsOldEnough }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'userProfileIsOldEnough' from 'comparisons.js'; | |
const what = ({api}) => { | |
const userProfile = api.fetchUserProfile(); | |
// Question: How can I allow userProfileIsOldEnough to access userProfile without | |
// passing it as an arg? | |
if (userProfileIsOldEnough()) { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment