1.0.46 • Published 10 months ago

togl-react-provider v1.0.46

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
10 months ago

Togl React Provider

Togl is a feature management platform that allows feature flags to help teams build better software, faster.

This version of the Togl is compatible with versions 16.3.0 and later of React because it uses React's Context API.

Togl Provider

import { ToglProvider } from 'togl-react-provider';
import Component from 'my-project';

function App() {
  return (
    <ToglProvider clientId="[clientid]">
      <Component />
    </ToglProvider>
  );
}

Togl Hooks

import { useToglClient, useToglFlags } from 'togl-react-provider';

const { initialized } = useToglClient();
const { myFlag } = useToglFlags<ToglFlags>();

function App() {

    if (!initialized) {
        return <div>Loading...</div>;
    }

    return (
     <div>
      {myFlag && (
          <h1>myFlag is active</h1>
      )}
      </div>
    );
}
1.0.39

10 months ago

1.0.38

10 months ago

1.0.40

10 months ago

1.0.44

10 months ago

1.0.43

10 months ago

1.0.42

10 months ago

1.0.41

10 months ago

1.0.46

10 months ago

1.0.45

10 months ago

1.0.37

10 months ago

1.0.36

10 months ago

1.0.35

10 months ago

1.0.34

10 months ago

1.0.32

10 months ago

1.0.31

10 months ago

1.0.30

10 months ago

1.0.29

10 months ago

1.0.28

10 months ago

1.0.27

10 months ago

1.0.26

10 months ago

1.0.25

10 months ago

1.0.24

10 months ago

1.0.23

10 months ago

1.0.22

10 months ago

1.0.21

10 months ago

1.0.20

11 months ago

1.0.19

11 months ago

1.0.18

11 months ago

1.0.17

11 months ago

1.0.16

11 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago