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

Make possible get function through get() method in config #15121

Conversation

illia-stv
Copy link
Contributor

@illia-stv illia-stv commented Oct 3, 2023

Suggested merge commit message (convention)

Fix (utils): Config#get() method should be able to return a function.
Closes #14804.
Closes #12835.


Additional information

For example – encountered issues, assumptions you had to make, other affected tickets, etc.

@illia-stv illia-stv requested a review from niegowski October 3, 2023 13:23
@illia-stv illia-stv self-assigned this Oct 3, 2023
Comment on lines 254 to 256
if ( source && typeof source[ name ] === 'function' ) {
return source[ name ];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could handle functions the same way as DOM node references (inside cloneConfig())?

@illia-stv illia-stv requested a review from niegowski October 4, 2023 14:42
Copy link
Contributor

@niegowski niegowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a test that accesses function from nested config, for example, config.get( 'options.callback' )

@niegowski niegowski merged commit 3cc09ac into master Oct 5, 2023
@niegowski niegowski deleted the ck/14804-using-callbacks-as-token-URL-value-in-ckbox-in-not-possible branch October 5, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants