Skip to content

Commit 23d1302

Browse files
committed
formatting
1 parent d39c713 commit 23d1302

5 files changed

Lines changed: 366 additions & 372 deletions

File tree

skipruntime-ts/examples/skipsocial-client.ts

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ if (!reactive) {
4040

4141
const client = await connect(`ws://localhost:${replication.toString()}`, creds);
4242

43-
4443
client.subscribe(
4544
reactive.collection,
4645
reactive.watermark,
@@ -53,31 +52,15 @@ client.subscribe(
5352
// Testing friend requests
5453
/*****************************************************************************/
5554

56-
const userID1 = "users-1"
57-
const userID2 = "users-2"
58-
const userID3 = "users-3"
55+
const userID1 = "users-1";
56+
const userID2 = "users-2";
57+
const userID3 = "users-3";
5958

59+
await fetchJSON(`${url}/user/${userID1}`, "PUT", {}, { country: "FR" });
6060

61-
await fetchJSON(
62-
`${url}/user/${userID1}`,
63-
"PUT",
64-
{},
65-
{ country: 'FR' },
66-
);
61+
await fetchJSON(`${url}/user/${userID2}`, "PUT", {}, { country: "UK" });
6762

68-
await fetchJSON(
69-
`${url}/user/${userID2}`,
70-
"PUT",
71-
{},
72-
{ country: 'UK' },
73-
);
74-
75-
await fetchJSON(
76-
`${url}/user/${userID3}`,
77-
"PUT",
78-
{},
79-
{ country: 'UK' },
80-
);
63+
await fetchJSON(`${url}/user/${userID3}`, "PUT", {}, { country: "UK" });
8164

8265
await fetchJSON(
8366
`${url}/friend-request/${newID("friendRequests")}`,
@@ -107,12 +90,7 @@ await fetchJSON(
10790
{ from: userID1, to: userID3 },
10891
);
10992

110-
111-
const friends2 = await fetchJSON(
112-
`${url}/friend/${userID1}`,
113-
"GET",
114-
header,
115-
);
93+
const friends2 = await fetchJSON(`${url}/friend/${userID1}`, "GET", header);
11694

11795
console.log(friends2);
11896

@@ -127,7 +105,6 @@ await fetchJSON(
127105
{ from: userID3, to: userID1, content: "Hello from userID3" },
128106
);
129107

130-
131108
await fetchJSON(
132109
`${url}/message/${newID("messages")}`,
133110
"PUT",
@@ -139,36 +116,28 @@ const params = new URLSearchParams({
139116
userID: userID1,
140117
});
141118

142-
console.log(await fetchJSON(
143-
`${url}/messages/${userID1}?${params}`,
144-
"GET",
145-
header,
146-
));
147-
119+
console.log(
120+
await fetchJSON(`${url}/messages/${userID1}?${params}`, "GET", header),
121+
);
148122

149123
/*****************************************************************************/
150124
/* Testing groups */
151125
/*****************************************************************************/
152126

153-
const groupID = "groupid-1"
154-
155-
127+
const groupID = "groupid-1";
156128

157129
await fetchJSON(
158130
`${url}/group/${groupID}`,
159131
"PUT",
160132
{},
161-
{ name: "this is my first group!",
162-
owner: userID1},
133+
{ name: "this is my first group!", owner: userID1 },
163134
);
164135

165136
await fetchJSON(
166137
`${url}/group-member/${groupID}`,
167138
"PUT",
168139
{},
169-
{ groupID,
170-
userID: userID2
171-
},
140+
{ groupID, userID: userID2 },
172141
);
173142

174143
/*
@@ -233,7 +202,6 @@ console.log(
233202
);
234203
*/
235204

236-
237205
/*
238206
239207
console.log('Set /user/123 to { name: "daniel", country: "UK" }');

0 commit comments

Comments
 (0)