launchdarkly / hello-react-native

Hello LaunchDarkly for React Native
4 stars 22 forks source link

Why is there so much redundant data? #10

Closed cj768025549 closed 4 years ago

cj768025549 commented 4 years ago

My code: // All Flags Listener const listener = (value: Object) => { // do something when feature flags change console.log('\n\n\nvalue======' + value) } this.launchDarklyClient.registerAllFlagsListener('MY_LISTENER', listener)

value======["test-123": LaunchDarkly.LDChangedFlag(key: "test-123", oldValue: Optional(shit), oldValueSource: Optional(LaunchDarkly.LDFlagValueSource.server), newValue: Optional(fuck), newValueSource: Optional(LaunchDarkly.LDFlagValueSource.server))]

I only want to get {"test-123":oldValue:shit,newValue:fuck}, how can I get this ?

bwoskow-ld commented 4 years ago

Hi @cj768025549 ,

The *Source fields tell you where the values came from. Some developers / use cases find this interesting, but if you don't need this information, feel free to ignore those fields. In your sample output, both the old and new values came from the LaunchDarkly server. Other potential values are that they came from a cache or a fallback value.

For future reference, this isn't the right place to file an issue like this. This repository is a sample application showing how to use the SDK and is not generally used for tracking SDK bugs or questions. If you have an SDK bug please file a ticket in the SDK issue tracker and if you have a question or need assistance please contact our support team by emailing support@launchdarkly.com.

Cheers, Ben