From 4ca56fb14ff0d111801bc061feb84848c34bb452 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Tue, 3 Oct 2023 00:40:04 -0500 Subject: [PATCH] [docs] Update consent README.md --- packages/consent/consent-tools/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/consent/consent-tools/README.md b/packages/consent/consent-tools/README.md index 658c6803d..5f590bfb7 100644 --- a/packages/consent/consent-tools/README.md +++ b/packages/consent/consent-tools/README.md @@ -9,7 +9,7 @@ import { createWrapper, resolveWhen } from '@segment/analytics-consent-tools' export const withCMP = createWrapper({ // Wrapper waits to load segment / get categories until this function returns / resolves - shouldLoad: (ctx) => { + shouldLoad: async (ctx) => { const CMP = await getCMP() await resolveWhen( () => !CMP.popUpVisible(), @@ -24,12 +24,12 @@ export const withCMP = createWrapper({ } }, - getCategories: () => { + getCategories: async () => { const CMP = await getCMP() return normalizeCategories(CMP.consentedCategories()) // Expected format: { foo: true, bar: false } }, - registerOnConsentChanged: (setCategories) => { + registerOnConsentChanged: async (setCategories) => { const CMP = await getCMP() CMP.onConsentChanged((event) => { setCategories(normalizeCategories(event.detail))