summaryrefslogtreecommitdiff
path: root/src/shapex.ts
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2025-04-21 12:03:36 +0300
committerAsko Nõmm <asko@nmm.ee>2025-04-21 12:03:36 +0300
commit1a9481066ad2fc02ebe1fb6a2e37ab30918bc065 (patch)
tree55022d76d0b75921c9b89969d11abe08a3dc0b53 /src/shapex.ts
parentb60e4887618f2b07c638a7fc0d0cff274e99e8ab (diff)
Refactor dispatch parameter naming from 'withData' to 'with' for consistency
Diffstat (limited to 'src/shapex.ts')
-rw-r--r--src/shapex.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shapex.ts b/src/shapex.ts
index d36e5e4..0366934 100644
--- a/src/shapex.ts
+++ b/src/shapex.ts
@@ -4,7 +4,7 @@
*/
export type SubscriptionResponseDispatch<W extends unknown = undefined> = {
to: string;
- withData?: W;
+ with?: W;
};
/**
@@ -258,15 +258,15 @@ export default function ShapeX<T extends object>(
if (response.dispatch) {
if (isSubscriptionResponseList(response.dispatch)) {
for (const dispatchee of response.dispatch) {
- if (dispatchee.withData) {
- dispatch(dispatchee.to, dispatchee.withData);
+ if (dispatchee.with) {
+ dispatch(dispatchee.to, dispatchee.with);
} else {
dispatch(dispatchee.to);
}
}
} else {
- if (response.dispatch.withData) {
- dispatch(response.dispatch.to, response.dispatch.withData);
+ if (response.dispatch.with) {
+ dispatch(response.dispatch.to, response.dispatch.with);
} else {
dispatch(response.dispatch.to);
}