Closed drakhart closed 2 years ago
const newSession = store.openSession();
const basicName = new BasicName();
basicName.name = "Toli";
await newSession.store(basicName, "users/1");
assert.strictEqual(Object.keys(newSession.advanced.whatChanged()).length, 1);
await newSession.saveChanges();
This is just a question, not a real issue: while using this library I came up with the idea of calling
session.saveChanges()
automatically before sending the server response (we're talking API here) whenever the session has unsaved/pending changes, but I couldn't find any way for checking for this (I inspected somesession
objects at different stages).So, is there any publicly accessible way to check if a session has currently unsaved changes?