Skip to content

Commit 7ab7c69

Browse files
committed
comment
1 parent e5a4bc9 commit 7ab7c69

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/core/decision_service/index.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ import {
7272
import { OptimizelyError } from '../../error/optimizly_error';
7373
import { CmabService } from './cmab/cmab_service';
7474
import { Maybe, OpType, OpValue } from '../../utils/type';
75-
import { opValue, Value } from '../../utils/promise/operation_value';
76-
import { error } from 'console';
77-
import { get } from 'http';
75+
import { Value } from '../../utils/promise/operation_value';
7876

7977
export const EXPERIMENT_NOT_RUNNING = 'Experiment %s is not running.';
8078
export const RETURNING_STORED_VARIATION =

lib/utils/promise/operation_value.ts

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ export const opValue = <OP extends OpType, V>(op: OP, val: V | Promise<V>): OpVa
1111
return Value.of(op, val).get();
1212
}
1313

14+
/**
15+
* A class to wraps a value that can be either a synchronous value or a promise and provides
16+
* a promise like API. This class is used to handle both synchronous and asynchronous values
17+
* in a uniform way.
18+
*/
1419
export class Value<OP extends OpType, V> {
1520
constructor(public op: OP, public val: OpValue<OP, V>) {}
1621

0 commit comments

Comments
 (0)