Merge pull request #24 from waku-org/chore/upgrade-waku-dep

chore: upgrade @waku/*
This commit is contained in:
Danish Arora 2023-09-12 00:04:04 +08:00 committed by GitHub
commit effaf55f64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 971 additions and 1860 deletions

2827
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@waku/react", "name": "@waku/react",
"version": "0.0.4", "version": "0.0.5",
"description": "React hooks and components to use js-waku", "description": "React hooks and components to use js-waku",
"type": "module", "type": "module",
"main": "dist/index.cjs.js", "main": "dist/index.cjs.js",
@ -66,7 +66,7 @@
"@types/react": "^18.0.28", "@types/react": "^18.0.28",
"@types/testing-library__jest-dom": "^5.14.5", "@types/testing-library__jest-dom": "^5.14.5",
"@typescript-eslint/eslint-plugin": "^5.52.0", "@typescript-eslint/eslint-plugin": "^5.52.0",
"@waku/interfaces": "^0.0.17", "@waku/interfaces": "^0.0.18",
"bundlewatch": "^0.3.3", "bundlewatch": "^0.3.3",
"eslint": "^8.34.0", "eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
@ -87,7 +87,7 @@
"typescript": "^4.9.5" "typescript": "^4.9.5"
}, },
"peerDependencies": { "peerDependencies": {
"@waku/sdk": "^0.0.18", "@waku/sdk": "^0.0.19",
"react": "^16.8.0 || ^17 || ^18" "react": "^16.8.0 || ^17 || ^18"
}, },
"bundlewatch": { "bundlewatch": {

View File

@ -3,7 +3,6 @@ import type {
IEncoder, IEncoder,
ILightPush, ILightPush,
IMessage, IMessage,
ProtocolOptions,
SendResult, SendResult,
Waku, Waku,
} from "@waku/interfaces"; } from "@waku/interfaces";
@ -17,10 +16,7 @@ type UseLightPushParams = {
node: undefined | AbstractLightPushNode; node: undefined | AbstractLightPushNode;
}; };
type PushFn = ( type PushFn = (message: IMessage) => Promise<SendResult>;
message: IMessage,
opts?: ProtocolOptions,
) => Promise<SendResult>;
type UseLightPushResult = { type UseLightPushResult = {
push?: undefined | PushFn; push?: undefined | PushFn;
@ -38,8 +34,8 @@ export const useLightPush = (
const { node, encoder } = params; const { node, encoder } = params;
const push = React.useCallback<PushFn>( const push = React.useCallback<PushFn>(
(message, opts = undefined) => { (message) => {
return node!.lightPush.send(encoder as IEncoder, message, opts); return node!.lightPush.send(encoder as IEncoder, message);
}, },
[node, encoder], [node, encoder],
); );