UNPKG

launchdarkly-react-client-sdk

Version:
21 lines • 902 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = require("react"); var context_1 = __importDefault(require("./context")); /** * `useFlags` is a custom hook which returns all feature flags. It uses the `useContext` primitive * to access the LaunchDarkly context set up by `withLDProvider`. As such you will still need to * use the `withLDProvider` HOC at the root of your app to initialize the React SDK and populate the * context with `ldClient` and your flags. * * @return All the feature flags configured in your LaunchDarkly project */ var useFlags = function () { var flags = react_1.useContext(context_1.default).flags; return flags; }; exports.default = useFlags; //# sourceMappingURL=useFlags.js.map