Skip to content
This repository was archived by the owner on Jan 27, 2024. It is now read-only.

Commit eb061c6

Browse files
committed
cleanup postmate resources on unrender
1 parent 00e0b17 commit eb061c6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
({
2+
unrender: function( component, helper ) {
3+
this.superUnrender();
4+
// When component unrenders then cleanup postmate
5+
// resources by destroying the child and nulling out
6+
// the helper's cached reference to the child.
7+
// This ensures that the helper.handleRestRequest(..) method
8+
// waits appropriately for the new parent-child handshake to complete
9+
// when this component is re-initialized and scripts are loaded.
10+
if ( helper._postmate ) {
11+
helper._postmate.destroy();
12+
helper._postmate = null;
13+
}
14+
}
15+
})

0 commit comments

Comments
 (0)