facebook/react — pull request #93 by ngavalas (2013-06-14 23:45:06+00:00)
Title: Adding optional callback argument to `setState`

We eventually want to batch calls to `setState` for performance reasons, and this no longer guarantees immediate, synchronous execution of these calls to `setState`. As such, this commit adds an optional callback parameter so that actions can be taken once the call actually runs.

@phunt says we shouldn't make the synchronous operation guarantee and @jwalke agrees.