Use union type for source state

This commit is contained in:
Andreas Hocevar
2021-09-04 20:55:13 +02:00
parent 492458a141
commit 57f147988d
24 changed files with 49 additions and 73 deletions
+1 -2
View File
@@ -5,7 +5,6 @@ import BaseLayer from './Base.js';
import EventType from '../events/EventType.js';
import LayerProperty from './Property.js';
import RenderEventType from '../render/EventType.js';
import SourceState from '../source/State.js';
import {assert} from '../asserts.js';
import {assign} from '../obj.js';
import {listen, unlistenByKey} from '../events.js';
@@ -213,7 +212,7 @@ class Layer extends BaseLayer {
*/
getSourceState() {
const source = this.getSource();
return !source ? SourceState.UNDEFINED : source.getState();
return !source ? 'undefined' : source.getState();
}
/**