change observed mutations into serializable records

This commit is contained in:
Yanzhen Yu
2018-10-08 15:47:21 +08:00
parent f8079fbea7
commit 427acff3d6
6 changed files with 280 additions and 39 deletions

11
src/utils.ts Normal file
View File

@@ -0,0 +1,11 @@
import { Mirror } from './types';
export const mirror: Mirror = {
map: {},
getId(n) {
return n.__sn && n.__sn.id;
},
getNode(id) {
return mirror.map[id];
},
};