Skip to content

Instantly share code, notes, and snippets.

@joeldenning
Created June 16, 2018 21:30
Show Gist options
  • Save joeldenning/5af651e3c51e15b73f7c05f1a4cfb2c7 to your computer and use it in GitHub Desktop.
Save joeldenning/5af651e3c51e15b73f7c05f1a4cfb2c7 to your computer and use it in GitHub Desktop.
single-spa parcel basic example
const parcel = singleSpa.mountRootParcel(parcelConfig, parcelProps)
// First wait for mounting to finish
parcel.mountPromise.then(() => {
// Then re-render the parcel
const newProps = {foo: 'bar'}
return parcel.update(newProps)
}).then(() => {
// Then unmount the parcel
return parcel.unmount()
}).catch(err => {
console.error(err)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment