[O] Optimize encapsulation

This commit is contained in:
Hykilpikonna
2019-12-21 11:51:12 -05:00
parent ea46d16836
commit e6cfa30ed4
+4 -12
View File
@@ -14,22 +14,14 @@ export default class Navigator
/**
* Update index
*
* @param hash
* @param index Hash and title | Hash only
* @param history Record in history or not (Default true)
*/
updateIndexHash(hash: string, history?: boolean)
updateIndex(index: Index | string, history?: boolean)
{
this.updateIndex({hash: hash}, history)
}
// Convert index format if it is hash only
if (typeof index == 'string') index = {hash: index};
/**
* Update index
*
* @param index Hash and title
* @param history Record in history or not (Default true)
*/
updateIndex(index: Index, history?: boolean)
{
// Call custom event
if (this.updateCallback != null) this.updateCallback();