Skip to content

Commit

Permalink
Merge pull request MithrilJS#1181 from barneycarroll/patch-4
Browse files Browse the repository at this point in the history
Gotchas imply onbeforeupdate is inherently evil
  • Loading branch information
lhorie authored Jul 31, 2016
2 parents f4b267f + 6c061a3 commit 608a494
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/lifecycle-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ var WorkingComponent = {

#### Avoid premature optimizations

The `onbeforeupdate` hook should only be used as a last resort. Avoid using it unless you have a noticeable performance issue.
You should only use `onbeforeupdate` to skip diffing as a last resort. Avoid using it unless you have a noticeable performance issue.

Typically performance problems that can be fixed via `onbeforeupdate` boil down to one large array of items. In this context, typically "large" means any array that contains a large number of nodes, be it in a wide spread (the infamous 5000 row table), or in a deep, dense tree.

Expand Down

0 comments on commit 608a494

Please sign in to comment.