How to use the @flopflip/react-broadcast.branchOnFeatureToggle function in @flopflip/react-broadcast

To help you get started, we’ve selected a few @flopflip/react-broadcast 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 / demo / src / App.js View on Github external
INCREMENT_SYNC_BUTTON,
} from './flags';

const UntoggledFeature = () =&gt; <h6>Disabled Feature</h6>;

const IncrementAsyncButton = props =&gt; (
  <button disabled="{props.isIncrementing}" type="button">
    Increment Async
  </button>
);
const FeatureToggledIncrementAsyncButton = flowRight(
  branchOnFeatureToggle({ flag: INCREMENT_ASYNC_BUTTON }, UntoggledFeature)
)(IncrementAsyncButton);

const IncrementSyncButton = props =&gt; (
  <button disabled="{props.isIncrementing}" type="button">
    Increment
  </button>

@flopflip/react-broadcast

A feature toggle wrapper to use LaunchDarkly with React

MIT
Latest version published 6 months ago

Package Health Score

77 / 100
Full package analysis