Skip to content

Commit

Permalink
clean up million-checkboxes example (#8)
Browse files Browse the repository at this point in the history
* Update example/package.json

---------

Co-authored-by: Ian Macartney <[email protected]>
  • Loading branch information
ldanilek and ianmacartney authored Nov 5, 2024
1 parent 83dfbc7 commit aa776d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
25 changes: 0 additions & 25 deletions example/convex/checkboxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,31 +96,6 @@ export const toggle = mutation({
handler: toggleHandler,
});

export const seed = internalMutation({
args: {},
handler: async (ctx) => {
const boxes = await ctx.db
.query("checkboxes")
.withIndex("idx")
.order("asc")
.collect();
// Clear the table.
for (const box of boxes) {
await ctx.db.delete(box._id);
}

const bytes = new Uint8Array(BOXES_PER_DOCUMENT / 8);

// Reset the table.
for (let i = 0; i < NUM_DOCUMENTS; i++) {
await ctx.db.insert("checkboxes", {
idx: i,
boxes: bytes.buffer,
});
}
},
});

export const toggleRandom = internalMutation({
args: {},
handler: async (ctx) => {
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"version": "0.0.0",
"scripts": {
"dev:backend": "convex dev --live-component-sources",
"dev:backend": "convex dev --live-component-sources --typecheck-components",
"dev:frontend": "vite",
"dev": "npm-run-all --parallel dev:backend dev:frontend",
"logs": "convex logs",
Expand Down

0 comments on commit aa776d2

Please sign in to comment.