loaders.gl
loaders.gl copied to clipboard
fix(RequestScheduler): Fix&improve GetPriorityFun signature
Fix and then improve type signature of getPriority
parameter of RequestScheduler.scheduleRequest
, so it accepts generic
Handle.
See: https://github.com/visgl/deck.gl/pull/6841/files#r866184522
Have you run tests on it? I guess it causes errors in existing code.
Yes i've ran tests (yarn test
) and full build (yarn build
). Do you have hints where to look for code that breaks?
Is it OK not to use generic here: https://github.com/visgl/loaders.gl/blob/f030d39d5cdedb137e43e757a9da10dd637857fd/modules/tiles/src/tileset/tileset-3d.ts#L296 ?
Is it OK not to use generic here:
https://github.com/visgl/loaders.gl/blob/f030d39d5cdedb137e43e757a9da10dd637857fd/modules/tiles/src/tileset/tileset-3d.ts#L296
?
I meant https://github.com/visgl/loaders.gl/blob/f030d39d5cdedb137e43e757a9da10dd637857fd/modules/tiles/src/tileset/tile-3d.ts#L376 . As I can see because of type Handle = any;
that includes undefined
it doesn't break code here.
Is it OK not to use generic here: this._getPriority.bind(this)
Yes, this is ok. RequestScheduler puts handle
as hint for getPriority
and it is free to use it to calculate priority or ignore completely.
In this case, TileHeader._getPriority
is already bound to its context via this
,so it is free to ignore handle
given by param.
Summarising, this typing update doesn't change anything in "currently" allowed behavior, it's just aligns typing with implementation and with current usage.
Close due to inactivity