mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 09:46:09 +03:00
Fundamental behaviour, not return type
This commit is contained in:
parent
f2da5fcf2c
commit
5f1f018a30
1 changed files with 5 additions and 5 deletions
|
@ -225,11 +225,11 @@ Unless otherwise specified, the following applies to all code:
|
|||
}
|
||||
```
|
||||
|
||||
37. Avoid functions whose behaviour / return type varies with different parameter types.
|
||||
Multiple return types are fine, but the function's fundamental behaviour should not
|
||||
change according its arguments: have two separate functions. For example, `SDKConfig.get()`
|
||||
with a string param which returns the type according to the param given is ok, but `SDKConfig.get()`
|
||||
with no args returning the whole config object would not be: this should just be a separate function.
|
||||
37. Avoid functions whose fundamental behaviour varies with different parameter types.
|
||||
Multiple return types are fine, but if the function's behaviour is going to change significantly,
|
||||
have two separate functions. For example, `SDKConfig.get()` with a string param which returns the
|
||||
type according to the param given is ok, but `SDKConfig.get()` with no args returning the whole
|
||||
config object would not be: this should just be a separate function.
|
||||
|
||||
## React
|
||||
|
||||
|
|
Loading…
Reference in a new issue