Merge pull request #210 from waku-org/chore/update-store-reactjs-chat

chore(store-reactjs-chat): bump to @waku/core 0.0.10
This commit is contained in:
Danish Arora 2023-02-09 13:00:09 +05:30 committed by GitHub
commit 52e3fb4afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2047 additions and 1367 deletions

View File

@ -1,8 +1,7 @@
import * as React from "react";
import protobuf from "protobufjs";
import { createRelayNode } from "@waku/create";
import { waitForRemotePeer } from "@waku/core";
import { createDecoder, createEncoder } from "@waku/core";
import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core";
const ContentTopic = `/js-waku-examples/1/chat/proto`;
const Encoder = createEncoder(ContentTopic);

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@waku/byte-utils": "^0.0.2",
"@waku/core": "^0.0.6",
"@waku/core": "^0.0.10",
"@waku/create": "^0.0.4",
"protobufjs": "^7.1.2",
"react": "^18.2.0",
@ -17,7 +17,7 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "PORT=3002 react-scripts start",
"start": "GENERATE_SOURCEMAP=false PORT=3002 react-scripts start",
"build": "react-scripts build",
"test": "exit 0",
"eject": "react-scripts eject"

View File

@ -1,12 +1,11 @@
import * as React from "react";
import protobuf from "protobufjs";
import { createLightNode } from "@waku/create";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import { DecoderV0 } from "@waku/core/lib/waku_message/version_0";
import { waitForRemotePeer, createDecoder } from "@waku/core";
import { bytesToUtf8 } from "@waku/byte-utils";
const ContentTopic = "/toy-chat/2/huilong/proto";
const Decoder = new DecoderV0(ContentTopic);
const decoder = createDecoder(ContentTopic);
const ProtoChatMessage = new protobuf.Type("ChatMessage")
.add(new protobuf.Field("timestamp", 1, "uint64"))
@ -56,7 +55,7 @@ function App() {
try {
for await (const messagesPromises of waku.store.queryGenerator(
[Decoder],
[decoder],
{
timeFilter: { startTime, endTime: new Date() },
pageDirection: "forward",