Skip to content

Commit f6391fb

Browse files
committed
datastore manager build errors
1 parent a61407c commit f6391fb

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

packages/framework/presence/src/latestMapValueManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ class LatestMapValueManagerImpl<
521521
key,
522522
value: itemValue,
523523
metadata,
524-
} satisfies LatestMapItemUpdatedClientData<T, Keys>;
524+
} satisfies LatestMapItemUpdatedClientData<T, Keys, RawValueAccessor<T>>;
525525
postUpdateActions.push(() => this.events.emit("remoteItemUpdated", updatedItem));
526526
allUpdates.items.set(key, { value: itemValue, metadata });
527527
} else if (hadPriorValue !== undefined) {

packages/framework/presence/src/latestValueManager.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,20 @@ class LatestValueManagerImpl<T, Key extends string>
154154
this.events.emit("localUpdated", { value: asDeeplyReadonly(value) });
155155
}
156156

157-
public getRemotes: () => IterableIterator<LatestClientData<T, ValueAccessor<T>>> =
158-
function* (this: LatestValueManagerImpl<T, Key>) {
159-
const allKnownStates = this.datastore.knownValues(this.key);
160-
for (const [attendeeId, value] of objectEntries(allKnownStates.states)) {
161-
if (attendeeId !== allKnownStates.self) {
162-
yield {
163-
attendee: this.datastore.lookupClient(attendeeId),
164-
value: asDeeplyReadonly(value.value),
165-
metadata: { revision: value.rev, timestamp: value.timestamp },
166-
};
167-
}
157+
public *getRemotes(
158+
this: LatestValueManagerImpl<T, Key>,
159+
): IterableIterator<LatestClientData<T, ValueAccessor<T>>> {
160+
const allKnownStates = this.datastore.knownValues(this.key);
161+
for (const [attendeeId, value] of objectEntries(allKnownStates.states)) {
162+
if (attendeeId !== allKnownStates.self) {
163+
yield {
164+
attendee: this.datastore.lookupClient(attendeeId),
165+
value: asDeeplyReadonly(unbrandJson(value.value)),
166+
metadata: { revision: value.rev, timestamp: value.timestamp },
167+
};
168168
}
169-
};
169+
}
170+
}
170171

171172
public getStateAttendees(): Attendee[] {
172173
const allKnownStates = this.datastore.knownValues(this.key);
@@ -268,8 +269,7 @@ export function latest<T extends object | null, Key extends string = string>(
268269
const internalValue =
269270
local === null
270271
? (local as unknown as InternalUtilityTypes.OpaqueJsonDeserialized<T>)
271-
: // FIXME: Why isn't this directly castable?
272-
(shallowCloneObject(
272+
: (shallowCloneObject(
273273
local,
274274
) as unknown as InternalUtilityTypes.OpaqueJsonDeserialized<T>);
275275
const value: InternalTypes.ValueRequiredState<T> = {

packages/framework/presence/src/latestValueTypes.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ export interface LatestData<T, TValueAccessor extends ValueAccessor<T>> {
9393
: TValueAccessor extends RawValueAccessor<T>
9494
? DeepReadonly<JsonDeserialized<T>>
9595
: never;
96-
// value: TValueAccessor;
97-
// value: [T] extends [ProxiedValueAccessor<T>]
98-
// ? () => DeepReadonly<JsonDeserialized<T>> | undefined
99-
// : [T] extends [RawValueAccessor<T>]
100-
// ? DeepReadonly<JsonDeserialized<T>>
101-
// : never;
102-
// value: Accessor<TValueAccessor>;
103-
// value: TValueAccessor;
10496
metadata: LatestMetadata;
10597
}
10698

0 commit comments

Comments
 (0)