@push-rpc/core
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -5,6 +5,6 @@ import { DataConsumer, DataSupplier, Topic, TopicImpl } from "./rpc"; | ||
export declare function groupReducer<D>(prevValue: any, newValue: any): any; | ||
export interface LocalTopicImplOpts<D, TD> { | ||
export interface LocalTopicImplOpts<D, F, TD> { | ||
throttleTimeout: number; | ||
throttleReducer: ThrottleArgsReducer<D>; | ||
triggerMapper: (d: TD) => Promise<D>; | ||
triggerMapper: (d: TD, filter: F) => Promise<D>; | ||
} | ||
@@ -15,3 +15,3 @@ /** LocalTopicImpl should implement Topic (and RemoteTopic) so it could be used in ServiceImpl */ | ||
private readonly opts; | ||
constructor(supplier: DataSupplier<D, F>, opts?: Partial<LocalTopicImplOpts<D, TD>>); | ||
constructor(supplier: DataSupplier<D, F>, opts?: Partial<LocalTopicImplOpts<D, F, TD>>); | ||
name: string; | ||
@@ -18,0 +18,0 @@ trigger(filter?: Partial<F>, suppliedData?: TD): void; |
@@ -139,3 +139,3 @@ "use strict"; | ||
if (!(suppliedData !== undefined)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, localTopic.opts.triggerMapper(suppliedData)]; | ||
return [4 /*yield*/, localTopic.opts.triggerMapper(suppliedData, filter)]; | ||
case 1: | ||
@@ -142,0 +142,0 @@ _a = _b.sent(); |
{ | ||
"name": "@push-rpc/core", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"main": "dist/index.js", | ||
@@ -20,3 +20,3 @@ "types": "dist/index.d.ts", | ||
}, | ||
"gitHead": "8c3531b9c19952ac22c846688f45cb22f9ace5bd" | ||
"gitHead": "f963e89a0d037be1a76a07e73cbd1836dca21d53" | ||
} |
@@ -14,6 +14,6 @@ import {DataConsumer, DataSupplier, MessageType, Topic, TopicImpl} from "./rpc" | ||
export interface LocalTopicImplOpts<D, TD> { | ||
export interface LocalTopicImplOpts<D, F, TD> { | ||
throttleTimeout: number | ||
throttleReducer: ThrottleArgsReducer<D> | ||
triggerMapper: (d: TD) => Promise<D> | ||
triggerMapper: (d: TD, filter: F) => Promise<D> | ||
} | ||
@@ -25,3 +25,3 @@ | ||
private readonly supplier: DataSupplier<D, F>, | ||
private readonly opts: Partial<LocalTopicImplOpts<D, TD>> = {} | ||
private readonly opts: Partial<LocalTopicImplOpts<D, F, TD>> = {} | ||
) { | ||
@@ -70,3 +70,3 @@ super() | ||
suppliedData !== undefined | ||
? await localTopic.opts.triggerMapper(suppliedData) | ||
? await localTopic.opts.triggerMapper(suppliedData, filter) | ||
: await localTopic.supplier(filter, session.createContext()) | ||
@@ -73,0 +73,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133997