launchdarkly-react-client-sdk
Advanced tools
Comparing version 2.29.1 to 2.29.2
@@ -69,11 +69,6 @@ "use strict"; | ||
const { ldClient, flags: fetchedFlags, error } = yield (0, initLDClient_1.default)(clientSideID, user, options, targetFlags); | ||
const initialFlags = (options === null || options === void 0 ? void 0 : options.bootstrap) && options.bootstrap !== 'localStorage' ? options.bootstrap : fetchedFlags; | ||
const LDProvider = ({ children }) => { | ||
const [ldData, setLDData] = (0, react_1.useState)({ | ||
flags: {}, | ||
unproxiedFlags: {}, | ||
flagKeyMap: {}, | ||
}); | ||
const [ldData, setLDData] = (0, react_1.useState)(() => (Object.assign({ unproxiedFlags: initialFlags }, (0, getFlagsProxy_1.default)(ldClient, initialFlags, reactOptions, targetFlags)))); | ||
(0, react_1.useEffect)(() => { | ||
const initialFlags = (options === null || options === void 0 ? void 0 : options.bootstrap) && options.bootstrap !== 'localStorage' ? options.bootstrap : fetchedFlags; | ||
setLDData(Object.assign({ unproxiedFlags: initialFlags }, (0, getFlagsProxy_1.default)(ldClient, initialFlags, reactOptions, targetFlags))); | ||
function onChange(changes) { | ||
@@ -80,0 +75,0 @@ const updates = (0, utils_1.getFlattenedFlagsFromChangeset)(changes, targetFlags); |
{ | ||
"name": "launchdarkly-react-client-sdk", | ||
"version": "2.29.1", | ||
"version": "2.29.2", | ||
"description": "LaunchDarkly SDK for React", | ||
@@ -5,0 +5,0 @@ "author": "LaunchDarkly <team@launchdarkly.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
98362
1756