-
Notifications
You must be signed in to change notification settings - Fork 87
feat(stateConfig): make state config more flexible #38
Conversation
This allows the provideStateConfig to accept more than an object or a string. Closes #20
☑️ Preflight Checklist:All questions must be addressed before this PR can be merged.
|
|
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 great to me. We should add a test case to Integration test to see if non string is parsed correctly as well.
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.
Does any documentation need to be updated or added to account for this change? If so was it done already?
Yes it should be updated in this PR
@@ -123,8 +123,7 @@ export const setStateConfig = (providedStateConfig) => { | |||
throw makeConfigEnvError(); | |||
} | |||
acc.client[key] = client[configEnv]; | |||
} | |||
if (typeof client === 'string') { | |||
} else { |
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.
keep validating the type
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.
So we want to only explicitly accept string, number, or boolean? The reason I did this was it puts the complexity to 13. I talked with @JAdshead and we came up with this solution.
This would require a |
This allows the provideStateConfig to accept more than an object
or a string.
Closes #20