Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/view-slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class ViewSlot {
* @param skipAnimation Should the removal animation be skipped?
* @return May return a promise if the view removal triggered an animation.
*/
remove(view: View, returnToCache?: boolean, skipAnimation?: boolean): void | Promise<View> {
remove(view: View, returnToCache?: boolean, skipAnimation?: boolean): void | Promise<View> | void{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR is getting merged, lets fix the return type of .remove, it should be the same as of .removeAt.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return this.removeAt(this.children.indexOf(view), returnToCache, skipAnimation);
}

Expand Down Expand Up @@ -275,9 +275,13 @@ export class ViewSlot {
* @param skipAnimation Should the removal animation be skipped?
* @return May return a promise if the view removal triggered an animation.
*/
removeAt(index: number, returnToCache?: boolean, skipAnimation?: boolean): View | Promise<View> {
removeAt(index: number, returnToCache?: boolean, skipAnimation?: boolean): View | Promise<View> | void {
let view = this.children[index];

if(!view) {
return;
}

let removeAction = () => {
index = this.children.indexOf(view);
view.removeNodes();
Expand Down