Skip to content

Commit 8c831d1

Browse files
committed
refactor: detach method use id arg instead model.id
1 parent 1112ee5 commit 8c831d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/view-model/view-model.store.base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,14 @@ export class ViewModelStoreBase<VMBase extends AnyViewModel = AnyViewModel>
311311

312312
const nextInstanceAttachedCount = attachedCount - 1;
313313

314-
this.instanceAttachedCount.set(model.id, nextInstanceAttachedCount);
314+
this.instanceAttachedCount.set(id, nextInstanceAttachedCount);
315315

316316
if (nextInstanceAttachedCount <= 0) {
317317
if ('willUnmount' in model) {
318318
model.willUnmount();
319319
}
320320

321-
this.instanceAttachedCount.delete(model.id);
321+
this.instanceAttachedCount.delete(id);
322322
this.viewModels.delete(id);
323323
this.dettachVMConstructor(model);
324324

0 commit comments

Comments
 (0)