Skip to content

Commit

Permalink
MY-12648 bump version and namespace events correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Sep 4, 2019
1 parent 139ec40 commit 2b634dc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@myparcel/checkout",
"version": "3.0.4",
"version": "3.0.5",
"types": "index.d.ts",
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
2 changes: 1 addition & 1 deletion src/Errors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default {
document.dispatchEvent(new Event(EVENTS.UPDATE_CHECKOUT_IN));
// Send the new values in an event. It's up to the external platform to do handle this event or not.
document.dispatchEvent(new CustomEvent(EVENTS.ADDRESS_UPDATED_OUT, { detail: this.values }));
document.dispatchEvent(new CustomEvent(EVENTS.UPDATE_ADDRESS_OUT, { detail: this.values }));
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/config/configBus.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const createConfigBus = () => {

initialize();

document.addEventListener(EVENTS.UPDATE_CONFIG, initialize);
document.addEventListener(EVENTS.UPDATE_CONFIG_IN, initialize);
},

methods: {
Expand Down
15 changes: 12 additions & 3 deletions src/config/data/eventConfig.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* configBus events
*/

/**
* Sent by configBus when a setting is updated.
*
Expand All @@ -19,12 +23,17 @@ export const AFTER_UPDATE = 'afterUpdate';
*/
export const ERROR = 'error';

/*
* Document events
* The following events should be namespaced to avoid any possible conflicts.
*/

/**
* This event is used to change the config after the initialization.
*
* @type {string}
*/
export const UPDATE_CONFIG = 'myparcel_update_config';
export const UPDATE_CONFIG_IN = 'myparcel_update_config';

/**
* For the external platform to tell this application to update.
Expand All @@ -38,11 +47,11 @@ export const UPDATE_CHECKOUT_IN = 'myparcel_update_checkout';
*
* @type {string}
*/
export const ADDRESS_UPDATED_OUT = 'address_updated';
export const UPDATE_ADDRESS_OUT = 'myparcel_updated_address';

/**
* To tell the external platform it needs to update.
*
* @type {string}
*/
export const UPDATE_CHECKOUT_OUT = 'update_checkout';
export const UPDATE_CHECKOUT_OUT = 'myparecl_updated_checkout';

0 comments on commit 2b634dc

Please sign in to comment.