Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ The Multi-Provider is a powerful tool for performing migrations between flag pro
- **Multiple Data Sources**: The Multi-Provider allows you to seamlessly combine many sources of flagging data, such as environment variables, local files, database values and SaaS hosted feature management systems.

```ts
import { WebMultiProvider } from '@openfeature/web-sdk';
import { MultiProvider } from '@openfeature/web-sdk';

const multiProvider = new WebMultiProvider([
const multiProvider = new MultiProvider([
{ provider: new ProviderA() },
{ provider: new ProviderB() }
]);
Expand All @@ -179,9 +179,9 @@ The Multi-Provider comes with three strategies out of the box:
- **ComparisonStrategy**: Evaluates all providers sequentially. If every provider returns a successful result with the same value, then that result is returned. Otherwise, the result returned by the configured "fallback provider" will be used.

```ts
import { WebMultiProvider, FirstSuccessfulStrategy } from '@openfeature/web-sdk';
import { MultiProvider, FirstSuccessfulStrategy } from '@openfeature/web-sdk';

const multiProvider = new WebMultiProvider(
const multiProvider = new MultiProvider(
[
{ provider: new ProviderA() },
{ provider: new ProviderB() }
Expand Down
18 changes: 9 additions & 9 deletions packages/web/src/provider/multi-provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ feature flagging interface. For example:

- *Migration*: When migrating between two providers, you can run both in parallel under a unified flagging interface. As flags are added to the
new provider, the Multi-Provider will automatically find and return them, falling back to the old provider if the new provider does not have
- *Multiple Data Sources*: The Multi-Provider allows you to seamlessly combine many sources of flagging data, such as environment variables,
- *Multiple Data Sources*: The Multi-Provider allows you to seamlessly combine many sources of flagging data, such as environment variables,
local files, database values and SaaS hosted feature management systems.

## Usage

The Multi-Provider is initialized with an array of providers it should evaluate:

```typescript
import { WebMultiProvider } from '@openfeature/web-sdk'
import { MultiProvider } from '@openfeature/web-sdk'
import { OpenFeature } from '@openfeature/web-sdk'

const multiProvider = new WebMultiProvider([
const multiProvider = new MultiProvider([
{ provider: new ProviderA() },
{ provider: new ProviderB() }
])
Expand All @@ -41,9 +41,9 @@ will fail with a FLAG_NOT_FOUND error code.
To change this behaviour, a different "strategy" can be provided:

```typescript
import { WebMultiProvider, FirstSuccessfulStrategy } from '@openfeature/web-sdk'
import { MultiProvider, FirstSuccessfulStrategy } from '@openfeature/web-sdk'

const multiProvider = new WebMultiProvider(
const multiProvider = new MultiProvider(
[
{ provider: new ProviderA() },
{ provider: new ProviderB() }
Expand All @@ -67,10 +67,10 @@ in configuration without affecting flag behaviour.
This strategy accepts several arguments during initialization:

```typescript
import { WebMultiProvider, ComparisonStrategy } from '@openfeature/web-sdk'
import { MultiProvider, ComparisonStrategy } from '@openfeature/web-sdk'

const providerA = new ProviderA()
const multiProvider = new WebMultiProvider(
const multiProvider = new MultiProvider(
[
{ provider: providerA },
{ provider: new ProviderB() }
Expand Down Expand Up @@ -137,10 +137,10 @@ The Multi-Provider supports tracking events across multiple providers, allowing
### Basic Tracking Usage

```typescript
import { WebMultiProvider } from '@openfeature/web-sdk'
import { MultiProvider } from '@openfeature/web-sdk'
import { OpenFeature } from '@openfeature/web-sdk'

const multiProvider = new WebMultiProvider([
const multiProvider = new MultiProvider([
{ provider: new ProviderA() },
{ provider: new ProviderB() }
])
Expand Down
2 changes: 0 additions & 2 deletions packages/web/src/provider/multi-provider/hook-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class HookExecutor {
if (err instanceof Error) {
this.logger.error(err.stack);
}
this.logger.error((err as Error)?.stack);
}
}
}
Expand All @@ -55,7 +54,6 @@ export class HookExecutor {
if (err instanceof Error) {
this.logger.error(err.stack);
}
this.logger.error((err as Error)?.stack);
}
}
}
Expand Down