Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
) => (
ToggledComponent: React.ComponentType
): React.ComponentType =>
// @ts-ignore
flowRight(
setDisplayName(wrapDisplayName(ToggledComponent, 'branchOnFeatureToggle')),
injectFeatureToggle(flag),
branchOnFeatureToggle(
UntoggledComponent,
DEFAULT_FLAG_PROP_KEY,
variation
)
)(ToggledComponent);
export default (flagName: FlagName, propKey?: string) => (
Component: React.ComponentType
): React.ComponentType =>
flowRight(
setDisplayName(wrapDisplayName(Component, 'injectFeatureToggle')),
withFlags(),
// @ts-ignore
injectFeatureToggle(flagName, propKey)
)(Component);
) => (
Component: React.ComponentType
): React.ComponentType =>
flowRight(
setDisplayName(wrapDisplayName(Component, 'injectFeatureToggles')),
withFlags(),
// @ts-ignore
injectFeatureToggles(flagNames, propKey, areOwnPropsEqual)
)(Component);
export default (flagName: FlagName, propKey?: string) => (
Component: React.ComponentType
): React.ComponentType =>
flowRight(
setDisplayName(wrapDisplayName(Component, 'injectFeatureToggle')),
// @ts-ignore
connect(mapStateToProps),
injectFeatureToggle(flagName, propKey)
)(Component);
) => (
Component: React.ComponentType
): React.ComponentType =>
flowRight(
setDisplayName(wrapDisplayName(Component, 'injectFeatureToggles')),
// @ts-ignore
connect(mapStateToProps),
injectFeatureToggles(flagNames, propKey, areOwnPropsEqual)
)(Component);
) => (WrappedComponent: ComponentType<$Diff>) =>
flowRight(
setDisplayName(wrapDisplayName(WrappedComponent, 'branchOnFeatureToggle')),
injectFeatureToggle(flag),
branchOnFeatureToggle(UntoggledComponent, DEFAULT_FLAG_PROP_KEY, variation)
)(WrappedComponent);
) => (WrappedComponent: ComponentType<$Diff>) =>
flowRight(
setDisplayName(wrapDisplayName(WrappedComponent, 'injectFeatureToggle')),
withFlags(),
injectFeatureToggle(flagName, propKey)
)(WrappedComponent);
) => (Component: React.ComponentType) =>
flowRight(
setDisplayName(wrapDisplayName(Component, 'branchOnFeatureToggle')),
injectFeatureToggle(flag),
branchOnFeatureToggle(UntoggledComponent, DEFAULT_FLAG_PROP_KEY, variation)
)(Component);
) => (Component: React.ComponentType): React.ComponentType => {
class EnhancedComponent extends React.PureComponent {
static displayName = wrapDisplayName(Component, 'withFlags');
render(): React.ReactNode {
return (
{flags => }
);
}
}
return EnhancedComponent;
};
) => (WrappedComponent: ComponentType<$Diff>) =>
flowRight(
setDisplayName(wrapDisplayName(WrappedComponent, 'branchOnFeatureToggle')),
injectFeatureToggle(flag),
branchOnFeatureToggle(UntoggledComponent, DEFAULT_FLAG_PROP_KEY, variation)
)(WrappedComponent);