VueTube/NUXT/plugins/classes/backType.js

17 lines
346 B
JavaScript
Raw Normal View History

2022-05-03 11:07:40 +00:00
// This is the class that populates the backStack array in the backHandler class.
export default class backType {
constructor(callback, check) {
this.callback = callback;
this.check = check || (() => true);
}
goBack() {
if (this.check()) {
this.callback();
return true;
} else {
return false;
}
}
}