You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Replaces `Symbol.asyncIterator` with a polyfill in bundled dependencies (specifically `EventIterator`).
61
+
*
62
+
* This is derived from an example in Rollup docs: https://rollupjs.org/plugin-development/#resolveid
63
+
*/
64
+
functionapplyAsyncIteratorPolyfill(){
65
+
// A fake file we import into every file using Symbol.asyncIterator
66
+
constPOLYFILL_ID='\0symbol-async-iterator';
67
+
68
+
return{
69
+
name: 'applyAsyncIteratorPonyfill',
70
+
asyncresolveId(source){
71
+
if(source===POLYFILL_ID){
72
+
return{id: POLYFILL_ID};
73
+
}
74
+
returnnull;
75
+
},
76
+
load(id){
77
+
if(id===POLYFILL_ID){
78
+
// Outside of Node.JS, we replace Symbol.asyncIterator with an import to this symbol. This allows us to use
79
+
// Symbol.asyncIterator internally. If users install the recommended polyfill, https://github.com/Azure/azure-sdk-for-js/blob/%40azure/core-asynciterator-polyfill_1.0.2/sdk/core/core-asynciterator-polyfill/src/index.ts#L4-L6
80
+
// they can also use our async iterables on React Native.
81
+
// Of course, we could also inline this definition with a simple replacement. But putting this in a fake module
0 commit comments