Skip to content

Commit

Permalink
fix: OpenFeature Web Provider exporting events emitter (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathannorris authored Jan 30, 2024
1 parent 316535c commit f940c83
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sdk/openfeature-web-provider/src/DevCycleProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export default class DevCycleProvider implements Provider {

private readonly options: DevCycleOptions
private readonly sdkKey: string
private _events = new OpenFeatureEventEmitter()

readonly events = new OpenFeatureEventEmitter()

private _devcycleClient: DevCycleClient | null = null
get devcycleClient(): DevCycleClient | null {
Expand All @@ -72,15 +73,15 @@ export default class DevCycleProvider implements Provider {
this._devcycleClient.eventEmitter.subscribe(
'configUpdated',
(allVariables) => {
this._events.emit(
this.events.emit(
ProviderEvents.ConfigurationChanged,
allVariables,
)
},
)

this._devcycleClient.eventEmitter.subscribe('error', (error) => {
this._events.emit(ProviderEvents.Error, error)
this.events.emit(ProviderEvents.Error, error)
})

if (!context) {
Expand Down

0 comments on commit f940c83

Please sign in to comment.