Cannot use `DefaultFlag`
matthewelwell opened this issue · comments
Both of the following snippets will log out undefined and attempting to instantiate a DefaultFlag
object will throw an error, meaning that it's not possible to use the DefaultFlag
constructor directly when defining default flag handler logic.
import { DefaultFlag } from "flagsmith-nodejs";
console.log(DefaultFlag);
const Flagsmith = require("flagsmith-nodejs");
console.log(Flagsmith.DefaultFlag);
Note that the current solution is to simply return an object in the same shape as the DefaultFlag class:
const handler = (featureName) => {
return { value: "foo", enabled: true, isDefault: true }
}