We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make the updateCounts operation complete in a group.Neither of the following attempts worked
@model("MyApp/Counter") class Counter extends Model({ count: prop(0) }) { @modelAction update(n: number) { this.count = n; } } export async function updateCounts(counter: Counter) { counter.update(111); await f(); counter.update(222); } export function f() { return new Promise((resolve) => { resolve(0); }); } test("1", async () => { const counter = new Counter({}); const undoManager = undoMiddleware(counter); const group = undoManager.createGroup(); await group.continue(async () => { await updateCounts(counter); }); }); test("2", async () => { const counter = new Counter({}); const undoManager = undoMiddleware(counter); await undoManager.withGroupFlow("withGroupFlow", function* () { yield* _await(updateCounts(counter)); }); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How to make the updateCounts operation complete in a group.Neither of the following attempts worked
The text was updated successfully, but these errors were encountered: