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

Unified Diff: sky/framework/fn.dart

Issue 985853002: Effen: willUmount->didUnmount, allow setState after didUnmount (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr comments 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 | « sky/examples/fn/widgets/material.dart ('k') | 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 e3d39eb1f2b9f30b363df9ac89feb593c2532540..99d91bb503962797f662df64ab7578b07a3ed113 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -528,9 +528,6 @@ void _renderDirtyComponents() {
void _scheduleComponentForRender(Component c) {
assert(!_inRenderDirtyComponents);
- if (_inRenderDirtyComponents)
- return;
-
_dirtyComponents.add(c);
if (!_renderScheduled) {
@@ -553,16 +550,16 @@ abstract class Component extends Node {
_order = _currentOrder + 1,
super(key:key);
- void willUnmount() {}
+ void didUnmount() {}
void _remove() {
assert(_rendered != null);
assert(_root != null);
- willUnmount();
_rendered._remove();
_rendered = null;
_root = null;
_removed = true;
+ didUnmount();
}
// TODO(rafaelw): It seems wrong to expose DOM at all. This is presently
@@ -640,10 +637,10 @@ abstract class Component extends Node {
}
void setState(Function fn()) {
- assert(_rendered != null); // cannot setState before mounting.
+ assert(_rendered != null || _removed); // cannot setState before mounting.
_stateful = true;
fn();
- if (_currentlyRendering != this) {
+ if (!_removed && _currentlyRendering != this) {
_dirty = true;
_scheduleComponentForRender(this);
}
« no previous file with comments | « sky/examples/fn/widgets/material.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698