Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1488)

Unified Diff: sky/framework/fn.dart

Issue 986753002: Add back didMount (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/fn.dart
diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart
index 99d91bb503962797f662df64ab7578b07a3ed113..fc6ef99bbd974e84918e8c736dfef6b88fda846a 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -550,6 +550,7 @@ abstract class Component extends Node {
_order = _currentOrder + 1,
super(key:key);
+ void didMount() {}
void didUnmount() {}
void _remove() {
@@ -602,6 +603,7 @@ abstract class Component extends Node {
}
var oldRendered = _rendered;
+ bool mounting = oldRendered == null;
int lastOrder = _currentOrder;
_currentOrder = _order;
_currentlyRendering = this;
@@ -621,6 +623,10 @@ abstract class Component extends Node {
}
_root = _rendered._root;
assert(_rendered._root is sky.Node);
+
+ if (mounting) {
+ didMount();
+ }
}
void _renderIfDirty() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698