deckgl-typings
deckgl-typings copied to clipboard
AsyncGenerator option missing from LayerProps.data
Acording to the deck.gl docs, the data attribute should support an AsyncGenerator function in the style of:
async function* getData() {
for (let i = 0; i < 10; i++) {
await const chunk = fetchChunk(...);
yield chunk;
}
}
function render() {
const layer = new ScatterplotLayer({
// When a new chunk arrives, deck.gl only updates the sub buffers for the new rows
data: getData(),
...
});
I have implemented such behavior but the build fails because LayerProps.data
doesn't have the option | AsyncGenerator<DataSet<D>>
.
Adding it makes sure the sample code builds, and the expected behavior works.
It seems like this kind of change would work, and it does for me. https://github.com/firefueled/deckgl-typings/commit/66e11b93766439288c30a6c1327b592e9aa8fa43
However, I'm not sure whether the lib
addition on tsconfig.json
is going to cause other troubles.
I could submit a PR if y'all are OK with it.
Sure, send a PR :)