'Mapbox gl: refer to different tile sources with different zoom levels

I'm coding a map and I have the following raster source:

{ 
  type: 'raster',
  tiles: [
       LinkA,
       LinkB
  ],
  tileSize: 256,
  scheme: 'tms' 

}

I want to switch to LinkB from a certain zoom level, how can I do that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source