forked from zulip/zulip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
typing_status: Use parameters for data rather than callbacks.
The real purpose these two callbacks serve is exactly what an ordinary parameter is perfect for: * Each has just one call site, at the top of the function. * They're not done for side effects; the point is what they return. * The function doesn't pass them any arguments of its own, or otherwise express any internal knowledge that doesn't just as properly belong to its caller. So, push the calls to these callbacks up into the function's caller, and pass in the data they return instead. This greatly simplifies the interface of `handle_text_input` and of `typing_status` in general.
- Loading branch information
Showing
4 changed files
with
27 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters