How to use the @flopflip/react.wrapDisplayName 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 / branch-on-feature-toggle / branch-on-feature-toggle.ts View on Github external
) => (
  ToggledComponent: React.ComponentType
): React.ComponentType =>
  // @ts-ignore
  flowRight(
    setDisplayName(wrapDisplayName(ToggledComponent, 'branchOnFeatureToggle')),
    injectFeatureToggle(flag),
    branchOnFeatureToggle(
      UntoggledComponent,
      DEFAULT_FLAG_PROP_KEY,
      variation
    )
  )(ToggledComponent);
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-broadcast / modules / components / inject-feature-toggles / inject-feature-toggles.ts View on Github external
) => (
  Component: React.ComponentType
): React.ComponentType =>
  flowRight(
    setDisplayName(wrapDisplayName(Component, 'injectFeatureToggles')),
    withFlags(),
    // @ts-ignore
    injectFeatureToggles(flagNames, propKey, areOwnPropsEqual)
  )(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-redux / modules / components / inject-feature-toggles / inject-feature-toggles.ts View on Github external
) => (
  Component: React.ComponentType
): React.ComponentType =>
  flowRight(
    setDisplayName(wrapDisplayName(Component, 'injectFeatureToggles')),
    // @ts-ignore
    connect(mapStateToProps),
    injectFeatureToggles(flagNames, propKey, areOwnPropsEqual)
  )(Component);
github tdeekens / flopflip / packages / react-broadcast / modules / components / branch-on-feature-toggle / branch-on-feature-toggle.js View on Github external
) => (WrappedComponent: ComponentType<$Diff>) =>
  flowRight(
    setDisplayName(wrapDisplayName(WrappedComponent, 'branchOnFeatureToggle')),
    injectFeatureToggle(flag),
    branchOnFeatureToggle(UntoggledComponent, DEFAULT_FLAG_PROP_KEY, variation)
  )(WrappedComponent);
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);
github tdeekens / flopflip / packages / react-redux / modules / components / branch-on-feature-toggle / branch-on-feature-toggle.ts View on Github external
) => (Component: React.ComponentType) =>
  flowRight(
    setDisplayName(wrapDisplayName(Component, 'branchOnFeatureToggle')),
    injectFeatureToggle(flag),
    branchOnFeatureToggle(UntoggledComponent, DEFAULT_FLAG_PROP_KEY, variation)
  )(Component);
github tdeekens / flopflip / packages / react-broadcast / modules / components / configure / with-flags.tsx View on Github external
) => (Component: React.ComponentType): React.ComponentType => {
  class EnhancedComponent extends React.PureComponent {
    static displayName = wrapDisplayName(Component, 'withFlags');

    render(): React.ReactNode {
      return (
        
          {flags => }
        
      );
    }
  }

  return EnhancedComponent;
};
github tdeekens / flopflip / packages / react-redux / modules / components / branch-on-feature-toggle / branch-on-feature-toggle.js View on Github external
) => (WrappedComponent: ComponentType<$Diff>) =>
  flowRight(
    setDisplayName(wrapDisplayName(WrappedComponent, 'branchOnFeatureToggle')),
    injectFeatureToggle(flag),
    branchOnFeatureToggle(UntoggledComponent, DEFAULT_FLAG_PROP_KEY, variation)
  )(WrappedComponent);