Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

[bad smell] ajax.js对于methods应该做filter #13

Open
ACERY1 opened this issue Mar 18, 2018 · 1 comment
Open

[bad smell] ajax.js对于methods应该做filter #13

ACERY1 opened this issue Mar 18, 2018 · 1 comment
Labels
Shit Smell The Bad Smell Of Code

Comments

@ACERY1
Copy link
Member

ACERY1 commented Mar 18, 2018

目前采用的是if...else来做的条件判断。
之后考虑通过hook来做优化,砍掉难看的if else

@ACERY1 ACERY1 added the Shit Smell The Bad Smell Of Code label Mar 18, 2018
@GeniusFunny
Copy link
Member

新建一个对象,使用对象的属性名来匹配method,避免if else;
如:obj['get'] 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Shit Smell The Bad Smell Of Code
Projects
None yet
Development

No branches or pull requests

2 participants