Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_empty(actorId) {
return Backend.init(actorId)
}
createDocument(keys: Keys): BackendManager {
const docId = Base58.encode(keys.publicKey)
log("Create", docId)
const doc = new BackendManager(this, docId, Backend.init())
this.docs.set(docId, doc)
this.initFeed(doc, keys)
return doc
}
constructor(core: RepoBackend, id: string) {
this.repo = core;
this.id = id;
this.back = Backend.init();
this.actorId = id;
this.subscribeToRemoteChanges();
this.subscribeToLocalChanges();
const history = (this.back as any).getIn(["opSet", "history"]).size;
this.repo.toFrontend.push({
type: "ReadyMsg",
id: this.id,
actorId: id,
history
});
}