UNPKG

@shopgate/pwa-common

Version:

Common library for the Shopgate Connect PWA.

42 lines 3.21 kB
import{APP_WILL_INIT,APP_WILL_START,APP_DID_START,PWA_DID_APPEAR,PWA_DID_DISAPPEAR,RESET_APP,WILL_REGISTER_LINK_EVENTS,DID_REGISTER_LINK_EVENTS,OPEN_DEEP_LINK,OPEN_PUSH_NOTIFICATION,OPEN_UNIVERSAL_LINK}from"../../constants/ActionTypes";/** * Creates the dispatched APP_WILL_INIT action object. * @param {Object} location The initial history entry location. * @return {Object} The dispatched action object. */export var appWillInit=function appWillInit(location){return{type:APP_WILL_INIT,location:location};};/** * Creates the dispatched APP_WILL_START action object. * @param {Object} location The initial history entry location. * @return {Object} The dispatched action object. */export var appWillStart=function appWillStart(location){return{type:APP_WILL_START,location:location};};/** * Creates the dispatched APP_DID_START action object. * @param {Object} location The initial history entry location. * @return {Object} The dispatched action object. */export var appDidStart=function appDidStart(location){return{type:APP_DID_START,location:location};};/** * Creates the dispatched RESET_APP action object. * @param {string[]} [reducers=undefined] The list of reducers to reset. * @return {Object} The dispatched action object. */export var resetApp=function resetApp(reducers){return{type:RESET_APP,reducers:reducers};};/** * Creates the dispatched PWA_DID_APPEAR action object. * @return {Object} The dispatched action object. */export var pwaDidAppear=function pwaDidAppear(){return{type:PWA_DID_APPEAR};};/** * Creates the dispatched PWA_DID_DISAPPEAR action * @return {Object} The dispatched action object. */export var pwaDidDisappear=function pwaDidDisappear(){return{type:PWA_DID_DISAPPEAR};};/** * Creates the dispatched WILL_REGISTER_LINK_EVENTS action object. * @return {Object} The dispatched action object. */export var willRegisterLinkEvents=function willRegisterLinkEvents(){return{type:WILL_REGISTER_LINK_EVENTS};};/** * Creates the dispatched DID_REGISTER_LINK_EVENTS action object. * @return {Object} The dispatched action object. */export var didRegisterLinkEvents=function didRegisterLinkEvents(){return{type:DID_REGISTER_LINK_EVENTS};};/** * Creates the dispatched OPEN_DEEP_LINK action object. * @param {Object} payload The payload of the deeplink * @return {Object} The dispatched action object. */export var openDeepLink=function openDeepLink(payload){return{type:OPEN_DEEP_LINK,payload:payload};};/** * Creates the dispatched OPEN_PUSH_NOTIFICATION action object. * @param {string} notificationId The notification ID. * @param {string} [link] The link of the notification. * @return {Object} The dispatched action object. */export var openPushNotification=function openPushNotification(notificationId){var link=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';return{type:OPEN_PUSH_NOTIFICATION,notificationId:notificationId,link:link};};/** * Creates the dispatched OPEN_UNIVERSAL_LINK action object. * @param {Object} payload The payload of the universal link. * @return {Object} The dispatched action object. */export var openUniversalLink=function openUniversalLink(payload){return{type:OPEN_UNIVERSAL_LINK,payload:payload};};