Skip to content

Instantly share code, notes, and snippets.

@gladchinda
Last active October 10, 2020 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gladchinda/be5104259284b96437ef14401144c54b to your computer and use it in GitHub Desktop.
Save gladchinda/be5104259284b96437ef14401144c54b to your computer and use it in GitHub Desktop.
/* eslint-disable */
import { createApp } from 'vue';
import { connect } from 'redux-vuex';
import App from './App.vue';
var onCheckoutReady = (function __once__(fn) {
if (typeof fn === 'function') {
let _invoked = false;
return function __invokableFunctionWithOnlyOneInvocation(...args) {
if (!_invoked && (_invoked = true)) return fn(...args);
};
}
return fn;
})(function onCheckoutReady(store) {
const { dispatch, getState, subscribe, ...actions } = store;
const app = createApp(App);
connect({ Vue: app, store });
app.provide('actions', actions);
app.mount('#root');
});
(function ready(fn) {
if (typeof fn === 'function') {
document.addEventListener('checkout:ready', (evt) => {
if (Object.prototype.toString.call(evt.detail) === '[object Object]') {
fn(evt.detail.store);
}
}, { once: true });
}
})(onCheckoutReady);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment