Created
June 16, 2018 21:30
-
-
Save joeldenning/5af651e3c51e15b73f7c05f1a4cfb2c7 to your computer and use it in GitHub Desktop.
single-spa parcel basic example
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
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