@@ -154,19 +154,20 @@ class LatestValueManagerImpl<T, Key extends string>
154
154
this . events . emit ( "localUpdated" , { value : asDeeplyReadonly ( value ) } ) ;
155
155
}
156
156
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
+ } ;
168
168
}
169
- } ;
169
+ }
170
+ }
170
171
171
172
public getStateAttendees ( ) : Attendee [ ] {
172
173
const allKnownStates = this . datastore . knownValues ( this . key ) ;
@@ -268,8 +269,7 @@ export function latest<T extends object | null, Key extends string = string>(
268
269
const internalValue =
269
270
local === null
270
271
? ( local as unknown as InternalUtilityTypes . OpaqueJsonDeserialized < T > )
271
- : // FIXME: Why isn't this directly castable?
272
- ( shallowCloneObject (
272
+ : ( shallowCloneObject (
273
273
local ,
274
274
) as unknown as InternalUtilityTypes . OpaqueJsonDeserialized < T > ) ;
275
275
const value : InternalTypes . ValueRequiredState < T > = {
0 commit comments