Notify data changes using Observer pattern
This pattern, in contrast with callbacks, allows us to clearly see the dependency and hierarchy between the objects. It will also help on writing unit tests as we can count how many times a notification was triggered.
This commit is contained in:
@@ -168,10 +168,7 @@ void MapContext::updateTiles() {
|
||||
if (!style) return;
|
||||
for (const auto& source : style->sources) {
|
||||
source->update(data, transformState, *style, *glyphAtlas, *glyphStore, *spriteAtlas,
|
||||
getSprite(), *texturePool, [this]() {
|
||||
assert(Environment::currentlyOn(ThreadType::Map));
|
||||
triggerUpdate();
|
||||
});
|
||||
getSprite(), *texturePool);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user