0.1.3 • Published 2 years ago

flagr-feature-react v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

flagr-feature-react

image

Usage

import { useFlagr, FlagrContextProvider } from 'flagr-feature-react';

const ID = 'user_123';
const SOME_URL = 'flagrUrl';
const APP_TAGS = ['local'];
const OPTIONAL_CONTEXT = undefined;

const MyApp = () => (
  <FlagrContextProvider
    flagrUrl={SOME_URL}
    tags={APP_TAGS}
    context={OPTIONAL_CONTEXT}
    id={ID}
  >
    <MyComponent />
  </FlagrContextProvider>
);

const MyComponent = () => {
  const { match, loaded } = useFlagr();

  return (
    <>
      {!loaded && 'loading'}
      {loaded && match?.('someFeature') ? 'new hotness' : 'old and busted'}
    </>
  );
};

Installation

Requires npm 7

npm install

Development

npm run dev

Deployment

npm run build

Publishing

This is handled by GitHub actions

0.1.3

2 years ago

0.1.3-c7bf4fc.0

2 years ago

0.1.2-653d08c.0

2 years ago

0.1.2-d0ec482.0

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.2-7d929b0.0

2 years ago

0.1.1

2 years ago

0.1.3-o214d46.0

2 years ago

0.0.9

2 years ago

0.1.2-17a14f3.0

2 years ago

0.0.8

2 years ago

0.1.2-8af53ff.0

2 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago