-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow interpolation return value to be a function. #346
Conversation
packages/emotion/src/index.js
Outdated
@@ -116,6 +116,10 @@ function handleInterpolation( | |||
return '' | |||
} | |||
|
|||
if (typeof interpolation === 'function') { | |||
return interpolation() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be handleInterpolation(interpolation())
Codecov Report
@@ Coverage Diff @@
## master #346 +/- ##
==========================================
+ Coverage 97.33% 97.34% +<.01%
==========================================
Files 17 17
Lines 562 564 +2
Branches 133 134 +1
==========================================
+ Hits 547 549 +2
Misses 11 11
Partials 4 4
Continue to review full report at Codecov.
|
What:
Allow the return value of dynamic values to be a function. This function will be called with zero arguments.
Why:
@CompuIves has some really cool stuff in his theme.
https://github.com/CompuIves/codesandbox-client/blob/master/src/common/theme.js#L23-L30
How:
Just call the interpolation if it is a function
Checklist: