-
-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add recommendation on how to handle unsafe async / remote fetch functions #39
Comments
Hey, @silesky. Thanks for raising this. I think the original suggestion of
I see little value in a What do you think about this? |
Completely agree! |
Do you think we should remove the "fetch" action from the suggested ones? |
Yes! |
Currently the only fetch example is:
“Fetch” is a synonym for get, and it — on its own —- implies a safe operation. How should we name unsafe operations that are also async, like update / delete etc?
to continue this pattern, we would expect:
... etc
Or, do we just forget the fetch altogether?
I’d like to propose just dropping the “fetchFoo” completely from the style guide, and not distinguish between fetching from a remote service or any other synchronous or asynchronous internal “getFoo” function.
The semantics of “fetchFoo” only differ from “getFoo” in that they encode a data type in the name (a promise), which is a potential code smell. (see #37)
The text was updated successfully, but these errors were encountered: