Skip to content
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

有需要用Typescript重写吗, 乐意PR #26

Closed
axetroy opened this issue Sep 19, 2017 · 6 comments
Closed

有需要用Typescript重写吗, 乐意PR #26

axetroy opened this issue Sep 19, 2017 · 6 comments

Comments

@axetroy
Copy link
Contributor

axetroy commented Sep 19, 2017

使用JS浑身不自在....

使用Typescript, 代码可读性大大提高, 减少N多BUG...

好吧, 我就是来安利的

@jawil
Copy link
Owner

jawil commented Sep 19, 2017

额,没用过啊,原生JavaScript控。语法bug对于我来说很少了,主要还是业务逻辑的bug,考虑不周全,这个不管用那种语言都是很难避免的,至于代码可读性代码多了逻辑复杂了都不好理解别人的思维😂

@axetroy
Copy link
Contributor Author

axetroy commented Sep 19, 2017

typescript写法与js并没有差异,只是类型检测系统。
用起来会很爽

@jawil
Copy link
Owner

jawil commented Sep 19, 2017

有了解过,但是没有具体去做项目用过,就是JavaScript的超集,对ES6/7/8也完美支持

@jawil
Copy link
Owner

jawil commented Sep 19, 2017

后续代码都会慢慢重构优化,哈哈,现在主要开发核心功能,还有好几个模块没时间开发

@axetroy
Copy link
Contributor Author

axetroy commented Sep 19, 2017

@jawil
有一个是.

里面的代码, 经常有扩写原生对象的方法.

这就导致了, 有些地方代码逻辑不清晰, 不推荐这么做...

比如这里

const attr = (HTMLElement.prototype.attr = function(attr, value) {
  return arguments[1] == void 0
    ? this.getAttribute(attr)
    : this.setAttribute(attr, value);
});

@jawil
Copy link
Owner

jawil commented Sep 19, 2017

主要是模拟JQ的attr方法,偷个懒少些代码,getAttribute有点太长了

@axetroy axetroy closed this as completed Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants