-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Allow function to be passed to Customizer settings/scopedSettings #4677
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 function to be passed to Customizer settings/scopedSettings #4677
Conversation
| return mergeSettingsWith(oldSettings); | ||
| } | ||
|
|
||
| function isSettingsFunction(settings?: Settings | SettingsFunction): settings is SettingsFunction { |
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.
👍
| export type Settings = { [key: string]: any }; | ||
| export type SettingsFunction = (settings: Settings) => Settings; | ||
|
|
||
| export type ICustomizerProps = Partial<{ |
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.
ICustomizations is now unused? Should you delete it?
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.
It's not really unused as the type is still used for the CustomizerContext and GlobalSettings.getValue. But we could indeed do a bit of cleanup, so i made some minor changes.
| export type SettingsFunction = (settings: Settings) => Settings; | ||
|
|
||
| export type ICustomizerProps = Partial<{ | ||
| settings: Settings | SettingsFunction; |
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.
Could you please add jsdoc to these?
* master: Added className to Calendar component (microsoft#4680) Fix bug for OWA+Safari+popup (microsoft#4681) Add optional props for custom divider rendering (microsoft#4687) Update package.json Add isEqual and isNotEqual utility (microsoft#4603) Fix minor typos (microsoft#4683) Allow function to be passed to Customizer settings/scopedSettings (microsoft#4677)
* master: Added className to Calendar component (microsoft#4680) Fix bug for OWA+Safari+popup (microsoft#4681) Add optional props for custom divider rendering (microsoft#4687) Update package.json Add isEqual and isNotEqual utility (microsoft#4603) Fix minor typos (microsoft#4683) Allow function to be passed to Customizer settings/scopedSettings (microsoft#4677)
Pull request checklist
$ npm run changeDescription of changes
Allows a function to be passed to the
<Customizer />This enables you to do the following
Bar would receive field="HelloWorld".
Focus areas to test
(optional)