[O] Optimize null case with param default

This commit is contained in:
Hykilpikonna
2019-12-21 13:40:46 -05:00
parent 57f29262e3
commit a3f03f5577
+1 -3
View File
@@ -46,15 +46,13 @@ export default class NavController
* @param index Hash and title | Hash only
* @param history Record in history or not (Default true)
*/
updateIndex(index: Index | string, history?: boolean)
updateIndex(index: Index | string, history: boolean = true)
{
index = this.checkIndex(index);
// Call custom event
if (this.updateCallback != null) this.updateCallback();
// Null case
if (history == null) history = true;
// Record history or not
if (history)
{