Last active
October 10, 2020 11:46
-
-
Save gladchinda/be5104259284b96437ef14401144c54b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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