How to use the @flopflip/react.injectFeatureToggle function in @flopflip/react

To help you get started, we’ve selected a few @flopflip/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tdeekens / flopflip / packages / react-broadcast / modules / components / inject-feature-toggle / inject-feature-toggle.ts View on Github external
export default (flagName: FlagName, propKey?: string) => (
  Component: React.ComponentType
): React.ComponentType =>
  flowRight(
    setDisplayName(wrapDisplayName(Component, 'injectFeatureToggle')),
    withFlags(),
    // @ts-ignore
    injectFeatureToggle(flagName, propKey)
  )(Component);
github tdeekens / flopflip / packages / react-redux / modules / components / inject-feature-toggle / inject-feature-toggle.ts View on Github external
export default (flagName: FlagName, propKey?: string) => (
  Component: React.ComponentType
): React.ComponentType =>
  flowRight(
    setDisplayName(wrapDisplayName(Component, 'injectFeatureToggle')),
    // @ts-ignore
    connect(mapStateToProps),
    injectFeatureToggle(flagName, propKey)
  )(Component);
github tdeekens / flopflip / packages / react-broadcast / modules / components / inject-feature-toggle / inject-feature-toggle.js View on Github external
) => (WrappedComponent: ComponentType<$Diff>) =>
  flowRight(
    setDisplayName(wrapDisplayName(WrappedComponent, 'injectFeatureToggle')),
    withFlags(),
    injectFeatureToggle(flagName, propKey)
  )(WrappedComponent);