Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit 0b0f6b6

Browse files
committed
SingleContextKey: Refine default value provider interface
1 parent 44c2a49 commit 0b0f6b6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/simple-context-key.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,8 @@ export class SingleContextKey<Value>
9494

9595
/**
9696
* A provider of context value used when there is no value associated with this key.
97-
*
98-
* If `undefined`, then there is no default value.
9997
*/
100-
readonly byDefault: (context: ContextValues) => Value | null | undefined;
98+
readonly byDefault: ContextValueProvider<ContextValues, Value>;
10199

102100
/**
103101
* Constructs single context value key.
@@ -106,7 +104,7 @@ export class SingleContextKey<Value>
106104
* @param byDefault Optional default value provider. If unspecified or `undefined` the key has no default
107105
* value.
108106
*/
109-
constructor(name: string, byDefault: (context: ContextValues) => Value | null | undefined = noop) {
107+
constructor(name: string, byDefault: ContextValueProvider<ContextValues, Value> = noop) {
110108
super(name);
111109
this.byDefault = byDefault;
112110
}

0 commit comments

Comments
 (0)