-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat: add RadioGroup middleware #918
Conversation
This pull request has been deployed to:
|
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.
Generally looks good, but needs to fix the unit test and fix the merge conflict. Might be good to get a screenshot of the examples so people can see too :)
middleware: { icache: icacheFactory() }, | ||
properties: () => ({}), | ||
children: () => [] | ||
})(onValueStub); |
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 am not 100% sure, but I think the build is failing because this is expecting the initialValue
argument
|
||
return (key: string) => ({ | ||
checked(checked?: boolean) { | ||
const existingValue = icache.get('value'); |
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 typed as a string icache.get<string>('value');
?
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.
same as above
|
||
export const radioGroup = factory(({ middleware: { icache } }) => { | ||
return (onValue: (value: string) => void, initialValue: string) => { | ||
const existingInitialValue = icache.get('initial'); |
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 typed as a string: icache.get<string>('initial');
?
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 typed above @JamesLMilner via RadioGroupICache
const factory = create({ radioGroup, theme }).properties<RadioGroupProperties>(); | ||
|
||
export const RadioGroup = factory(function({ properties, middleware: { radioGroup, theme } }) { | ||
const { name, label, options, renderer, onValue, initialValue } = properties(); |
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.
you could do initialValue = ''
here rather than use ||
below.
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.
Looks good to me @bitpshr . Just needs the conflicts sorted and the test fixed. @JamesLMilner there's no need for a screenshot as there's a link automatically added to the PR to the example runner.
This pull request has been deployed to:
|
This pull request has been deployed to: |
This pull request has been deployed to:
|
Type: feature
The following has been addressed in the PR:
theme.compose
like thisDescription:
This pull request adds a new
RadioGroup
widget and associated middleware.Resolves #798