I have a JS library (lets call it library 'a') which is an angular app component and is served through a CDN. I also have another library (let call it library 'b') which was written in typescript and transpiled down to es6.
I am loading both these libraries inside of a .Net MVC Knockoutjs application. I am facing an issue, when I load library 'a' it modifies native promises, and library 'b' relies on native promises to perform operations inside it.
If I remove library 'a' from the page and only load library 'b' it works fine.
When I only load library 'b' this is what window.Promise
looks like -
When I load library 'a' this is what window.Promise
looks like -
And after loading library 'a' if I load library 'b', the Promises inside this library 'b' begins to fail. Seems like all instanceof Promise
evaluate to false even if it is a Promise
This is from library 'b'
I am loading these libraries on a user click and add it to DOM using jquery $getScript('', ()=> {})
I am wondering, if there's a way to revert window.Promise
back to the native, when I am about to load library 'b'
I am pretty new to Promises, any help is appreciated.
Thanks.