How to use @flopflip/react-broadcast - 5 common examples

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 commercetools / merchant-center-application-kit / packages / application-shell / src / test-utils / test-utils.spec.js View on Github external
const TestComponent = () => {
    const isFeatureEnabled = useFeatureToggle(FEATURE_NAME);

    return <p>Enabled: {isFeatureEnabled ? 'Yes' : 'No'}</p>;
  };
  it('should not enable features toggles by default', async () =&gt; {
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / navbar / navbar.js View on Github external
export const NavBar = props => {
  const ref = React.useRef();
  const areProjectExtensionsEnabled = useFeatureToggle(PROJECT_EXTENSIONS);
  const disabledMenuItems = useApplicationContext(
    context => context.environment.disabledMenuItems
  );
  const menuVisibilities = useApplicationContext(
    context => context.menuVisibilities
  );
  const applicationsMenu = useApplicationsMenu({
    queryOptions: {
      onError: reportErrorToSentry,
    },
    skipRemoteQuery: !props.environment.servedByProxy,
    options: {
      __DEV_CONFIG__: {
        menuLoader: props.DEV_ONLY__loadNavbarMenuConfig,
        menuKey: 'navBar',
      },
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>
github tdeekens / flopflip / demo / src / App.js View on Github external
<button disabled="{props.isIncrementing}" type="button">
    Increment
  </button>
);

const FeatureToggledIncrementSyncButton = injectFeatureToggle(
  INCREMENT_SYNC_BUTTON,
  'syncButtonStyle'
)(IncrementSyncButton);

const Counter = props =&gt; (
  <div>
    <h1>Count around</h1>
    <p>Count: {props.count}</p>

    <div>
      
      <br>
      </div></div>
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / quick-access / quick-access.js View on Github external
}
        }}
        search={this.search}
        executeCommand={this.executeCommand}
        onClose={this.props.onClose}
        getNextCommands={this.getNextCommands}
      />
    );
  }
}

export default flowRight(
  withApollo,
  injectIntl,
  withRouter,
  injectFeatureToggles(['pimSearch', 'customApplications', 'canViewDashboard']),
  withApplicationContext(),
  connect(null, (dispatch, ownProps) => ({
    pimSearchProductIds: searchText =>
      dispatch(
        sdkActions.post({
          uri: `/${ownProps.applicationContext.project.key}/search/products`,
          mcApiProxyTarget: MC_API_PROXY_TARGETS.PIM_SEARCH,
          payload: {
            query: {
              fullText: {
                field: 'name',
                language: ownProps.applicationContext.dataLocale,
                value: searchText,
              },
            },
            sort: [

@flopflip/react-broadcast

A feature toggle wrapper to use LaunchDarkly with React

MIT
Latest version published 2 days ago

Package Health Score

81 / 100
Full package analysis