Afraid not, so I wrote you one 🙂
For simplicity, I load up a few WebMaps ahead of time (you might want to do this on-the-fly in your app). I'll use these as basemap options. I'll also load up one WebMap with actual content. When the user picks a different basemap, I reference the content WebMap and the appropriate basemap WebMap.
The only additional trick is to store and set the extent "around" the basemap change, otherwise each basemap change returns the map view to the content WebMap's default (saved) extent.
I also don't initially set the basemap, but just rely on the "Content" basemap. You'd want to take care of that in a real app.
Hope this helps,
Nick.