I have the following JS code and I'm trying to convert to aura component JS Controller, I'm getting error on the yield
how would you make equivalent aura component code
function* createChunkGenerator(
itemList = [], chunkSize = 1, chunkCount = 0
) {
chunkSize = Math.max(chunkSize, 1);
while (itemList.length >= 1) {
++chunkCount;
yield {
chunkCount,
itemList: itemList.splice(0, chunkSize),
};
}
}
const chunkGenerator = createChunkGenerator(data, 5);
Aura component javascript:
createChunkGenerator: function( ) {
//....
},