File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,7 +188,17 @@ export class YjsProvider {
188188 updateBinary = new Uint8Array ( parsed . update ) ;
189189 }
190190
191- console . log ( "증분값 적용 전, " , this . doc . getArray ( "cards" ) ) ;
191+ const logCards = ( label : string ) => {
192+ const arr = this . doc . getArray ( "cards" ) ;
193+ const cards = arr . map ( ( cardMap : Y . Map < any > ) => ( {
194+ id : cardMap . get ( "id" ) ,
195+ question : cardMap . get ( "question" ) ?. toString ( ) ,
196+ answer : cardMap . get ( "answer" ) ?. toString ( ) ,
197+ } ) ) ;
198+ console . log ( label , cards ) ;
199+ } ;
200+
201+ logCards ( "증분값 적용 전" ) ;
192202
193203 Y . applyUpdate ( this . doc , updateBinary , this ) ;
194204
@@ -199,7 +209,7 @@ export class YjsProvider {
199209 }
200210 }
201211
202- console . log ( "증분값 적용 후, " , this . doc . getArray ( "cards" ) ) ;
212+ logCards ( "증분값 적용 후" ) ;
203213 } ) ;
204214
205215 // Awareness 메시지 처리
You can’t perform that action at this time.
0 commit comments