Skip to content

Commit 5219b6f

Browse files
committed
fix: using GrowthBook renderer interface to trigger ConfigurationChanged events instead of patching specific methods
1 parent 775a7c8 commit 5219b6f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

libs/providers/growthbook-client/src/lib/growthbook-client-provider.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,9 @@ export class GrowthbookClientProvider implements Provider {
4747

4848
await this.client.init(this._initOptions);
4949

50-
// Monkey-patch the setPayload function to fire an event
51-
const setPayload = this._client.setPayload.bind(this._client);
52-
53-
this._client.setPayload = async (...args) => {
54-
await setPayload(...args);
50+
this._client.setRenderer(() => {
5551
this.events.emit(ProviderEvents.ConfigurationChanged);
56-
};
52+
});
5753
}
5854

5955
async onClose(): Promise<void> {

0 commit comments

Comments
 (0)