Mapview's when() event on view giving error?

I have a view which uses a webmap instance. According to the documentation, MapView can leverage the when() function to indicate that the view is ready to be manipulated. But I'm getting a "view.when is not a function" error in browser console.

At 4.6,then()is deprecated in favor ofwhen(). Thethen()method will still be honored at 4.6, but will throw warning messages in the browser developer console, to ease the process of updating apps to usingwhen(). We made this change to allow the use of native ES6 promises within the context of the ArcGIS API for JavaScript.

At 4.6,then()is deprecated in favor ofwhen(). Thethen()method will still be honored at 4.6, but will throw warning messages in the browser developer console, to ease the process of updating apps to usingwhen(). We made this change to allow the use of native ES6 promises within the context of the ArcGIS API for JavaScript.