@wildberries/databus-service-products
Advanced tools
Comparing version 0.1.2 to 0.1.3-beta.1
export declare const FETCH_PRODUCTS = "fetch-products"; | ||
export declare const NAVIGATE_TO_PRODUCT = "navigate-to-product"; | ||
export declare const PREFETCH_PRODUCT = "prefetch-product"; |
@@ -5,1 +5,2 @@ "use strict"; | ||
exports.NAVIGATE_TO_PRODUCT = 'navigate-to-product'; | ||
exports.PREFETCH_PRODUCT = 'prefetch-product'; |
@@ -1,3 +0,4 @@ | ||
import { FetchMenuActionPayloadType, NavigateToRouteParamsType } from './types'; | ||
import { FetchMenuActionPayloadType, NavigateToRouteParamsType, PrefetchProductParamsType } from './types'; | ||
export declare const setFetchProductsEvent: (params: FetchMenuActionPayloadType) => void; | ||
export declare const navigateToProductEvent: (params: NavigateToRouteParamsType) => void; | ||
export declare const prefetchProductEvent: (params: PrefetchProductParamsType) => void; |
@@ -17,1 +17,7 @@ "use strict"; | ||
}; | ||
exports.prefetchProductEvent = function (params) { | ||
new databus_1.Databus({ name: constants_1.PREFETCH_PRODUCT }).addEvent({ | ||
detail: params, | ||
}); | ||
databus_1.Databus.dispatchEvent({ eventName: constants_1.PREFETCH_PRODUCT }); | ||
}; |
@@ -1,3 +0,4 @@ | ||
import { FetchMenuActionPayloadType, ListenerType, NavigateToRouteParamsType } from './types'; | ||
import { FetchMenuActionPayloadType, ListenerType, NavigateToRouteParamsType, PrefetchProductParamsType } from './types'; | ||
export declare const setFetchProductsListener: (listener: ListenerType<FetchMenuActionPayloadType>) => void; | ||
export declare const setNavigateProductListener: (listener: ListenerType<NavigateToRouteParamsType>) => void; | ||
export declare const setPrefetchProductListener: (listener: ListenerType<PrefetchProductParamsType>) => void; |
@@ -15,1 +15,6 @@ "use strict"; | ||
}; | ||
exports.setPrefetchProductListener = function (listener) { | ||
new databus_1.Databus({ name: constants_1.PREFETCH_PRODUCT }).addEventListener({ | ||
listener: listener, | ||
}); | ||
}; |
@@ -57,1 +57,8 @@ export declare type BaseAction = () => { | ||
}; | ||
export declare type PrefetchProductParamsType = { | ||
menuName: string; | ||
routeName?: string; | ||
} | { | ||
menuName?: string; | ||
routeName: string; | ||
}; |
{ | ||
"name": "@wildberries/databus-service-products", | ||
"version": "0.1.2", | ||
"version": "0.1.3-beta.1", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
10908
184