Skip to content

Commit

Permalink
update test snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
a-type committed Jul 19, 2024
1 parent 3807414 commit 2bfc6dd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
54 changes: 24 additions & 30 deletions packages/cli/test/__snapshots__/generated.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ import {
export type Todo = ObjectEntity<TodoInit, TodoDestructured, TodoSnapshot>;
export type TodoId = string;
/** The content of the todo item */
export type TodoContent = string;
/** Whether the todo item is done */
export type TodoDone = boolean;
/** Attach tags to an item to categorize it */
export type TodoTags = ListEntity<
TodoTagsInit,
TodoTagsDestructured,
Expand Down Expand Up @@ -433,43 +436,34 @@ var todo = schema.collection({
name: "todo",
primaryKey: "id",
fields: {
id: {
type: "string",
default: () => Math.random().toString(36).slice(2, 9)
},
content: {
type: "string",
default: ""
},
done: {
type: "boolean"
},
tags: {
type: "array",
id: schema.fields.id(),
content: schema.fields.string({
default: "",
documentation: "The content of the todo item"
}),
done: schema.fields.boolean({
documentation: "Whether the todo item is done"
}),
tags: schema.fields.array({
items: {
type: "string",
options: ["work", "home", "other"]
}
},
category: {
type: "string",
},
documentation: "Attach tags to an item to categorize it"
}),
category: schema.fields.string({
nullable: true
},
attachments: {
type: "array",
items: {
type: "object",
}),
attachments: schema.fields.array({
items: schema.fields.object({
properties: {
name: {
type: "string"
},
test: {
type: "number",
name: schema.fields.string(),
test: schema.fields.number({
default: 1
}
})
}
}
}
})
})
},
indexes: {
example: {
Expand Down
7 changes: 6 additions & 1 deletion packages/store/src/sync/Sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ export interface ServerSyncOptions<Profile = any, Presence = any>
* Not sure why you want to do this, but be careful.
*/
onOutgoingMessage?: (message: ClientMessage) => void;

EXPERIMENTAL_backgroundSync?: boolean;
}

export class ServerSync<Presence = any, Profile = any>
Expand Down Expand Up @@ -226,6 +228,7 @@ export class ServerSync<Presence = any, Profile = any>
defaultProfile,
useBroadcastChannel,
onOutgoingMessage,
EXPERIMENTAL_backgroundSync,
}: ServerSyncOptions<Profile, Presence>,
{
meta,
Expand Down Expand Up @@ -334,7 +337,9 @@ export class ServerSync<Presence = any, Profile = any>
this.start();
}

attemptToRegisterBackgroundSync();
if (EXPERIMENTAL_backgroundSync) {
attemptToRegisterBackgroundSync();
}
}

get canDoRealtime() {
Expand Down

0 comments on commit 2bfc6dd

Please sign in to comment.