简体   繁体   中英

babel 7 and function bind operator

I plan to migrate to babel 7 and I want to stop using presets in favor of manual adding plug-ins. I like the binding operator and I see that there are several packages: @babel/plugin-proposal-function-bind, @babel/plugin-syntax-function-bind and babel-plugin-transform-function-bind. Which one should I use and why?

you should use @babel/plugin-proposal-function-bind, it does the both recognition and the transform.

@babel/plugin-syntax-function-bind only allow the :: operator but do not transform it.

and it seems babel 7 move all plugin under @babal scope

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM