publishFlags
function publishFlags(core, flags): Promise<string>;Defined in: testing.ts:143
Upsert flags into the draft and publish a snapshot in one call. Returns the version.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
core |
FlagsCore |
flags |
Flag[] |
Returns
Section titled “Returns”Promise<string>
Example
Section titled “Example”import { createTestPanel, booleanFlag, publishFlags } from "@xtandard/flags/testing";
const { core } = createTestPanel();const version = await publishFlags(core, [ booleanFlag("feature-a"), booleanFlag("feature-b", { default: true }),]);console.log(version); // "v1"