Skip to content

Commit 8bf9af3

Browse files
committed
Removed ExecutorAnnotations type
1 parent 183b0c6 commit 8bf9af3

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

src/main/ExecutorImpl.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import { AbortablePromise, PubSub } from 'parallel-universe';
22
import type { ExecutorManager } from './ExecutorManager.js';
3-
import type {
4-
Executor,
5-
ExecutorAnnotations,
6-
ExecutorEvent,
7-
ExecutorState,
8-
ExecutorTask,
9-
PartialExecutorEvent,
10-
} from './types.js';
3+
import type { Executor, ExecutorEvent, ExecutorState, ExecutorTask, PartialExecutorEvent } from './types.js';
114
import { AbortError, isPromiseLike, preventUnhandledRejection } from './utils.js';
125

136
/**
@@ -22,7 +15,7 @@ export class ExecutorImpl<Value = any> implements Executor {
2215
settledAt = 0;
2316
invalidatedAt = 0;
2417
isFulfilled = false;
25-
annotations: ExecutorAnnotations = {};
18+
annotations: Record<PropertyKey, any> = {};
2619
version = 0;
2720
promise: AbortablePromise<Value> | null = null;
2821

@@ -254,7 +247,7 @@ export class ExecutorImpl<Value = any> implements Executor {
254247
});
255248
};
256249

257-
annotate = (patch: ExecutorAnnotations): void => {
250+
annotate = (patch: Record<PropertyKey, any>): void => {
258251
this.version++;
259252
Object.assign(this.annotations, patch);
260253
this.publish({ type: 'annotated' });

src/main/core.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export { hydrateExecutorManager, type HydrateExecutorManagerOptions } from './hy
1212
export { ExecutorManager, type ExecutorManagerOptions } from './ExecutorManager.js';
1313
export {
1414
type Executor,
15-
type ExecutorAnnotations,
1615
type ExecutorEventType,
1716
type ExecutorEvent,
1817
type ExecutorState,

src/main/types.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
import type { AbortablePromise } from 'parallel-universe';
22
import type { ExecutorManager } from './ExecutorManager.js';
33

4-
/**
5-
* Annotations that allow to associate arbitrary metadata with the {@link Executor} instance.
6-
*
7-
* @see {@link Executor.annotate}
8-
*/
9-
export interface ExecutorAnnotations {
10-
readonly [key: PropertyKey]: any;
11-
}
12-
134
/**
145
* The type of the event.
156
*
@@ -171,7 +162,7 @@ export interface ExecutorState<Value = any> {
171162
/**
172163
* The map of annotations associated with the executor.
173164
*/
174-
readonly annotations: ExecutorAnnotations;
165+
readonly annotations: Record<PropertyKey, any>;
175166

176167
/**
177168
* The timestamp when the executor was settled, or 0 if it isn't settled.
@@ -396,7 +387,7 @@ export interface Executor<Value = any> extends ReadonlyExecutor<Value> {
396387
*
397388
* @param patch The patch containing new annotations.
398389
*/
399-
annotate(patch: ExecutorAnnotations): void;
390+
annotate(patch: Record<PropertyKey, any>): void;
400391
}
401392

402393
/**

0 commit comments

Comments
 (0)