Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.

Offline flags should be undefined, not null #57

@ericclemmons

Description

@ericclemmons

This way, you can take advantage of default args for clean defaults:

const defaultFlags = {
  "testing": "Oy! I use this when testing!",
};

ldClient.all_flags(
  user,
  (err, flags = defaultFlags) => err ? reject(err) : resolve(flags)
);

Alternatively, support:

const ldClient = new LaunchDarkly.init(process.env.LAUNCHDARKLY_TOKEN, {
  offline: process.env.NODE_ENV === "test" ? { ... } : false,
});

But that would conflict with the .variation(...) default value signature, so...nah.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions