【发布时间】:2015-08-30 14:27:02
【问题描述】:
我刚开始支持一个庞大的 Backbone 和 Marionette 应用程序。目前使用Underscore,版本为1.7.0。
我想切换到Lodash 最新版本,以利用我今天从另一篇文章中学到的新功能,_.has() 的深度搜索。我也在使用RequireJS
切换到Lodash 的最安全方法是什么?我是吗
1. bower install lodash
2. update require.confg
"underscore": "../components/underscore/underscore",
"underscore.string": "../components/underscore.string/lib/underscore.string",
and update the values to point to `lodash` paths but keep the property names?
这是一个可能适用于也可能不适用于 Lodash 的示例。这只是一个例子。
convertModels: function convertModels() {
_.each(this.models, _.bind(function (model) {
model = this.convertItem(model);
}, this));
},
这篇文章也是关于“我需要更改一些下划线代码”还是 Lodash 能够处理和产生相同的输出。或者我只需要检查应用程序,看看会发生什么?
【问题讨论】:
-
很遗憾,因为我的语法不好,我被从这个帖子中扣除了。我尽力了,尤其是英语不是我的母语。虽然变化很小。编辑说的“骨干/木偶”很糟糕。它改成了“Backbone/Marionette”,但我决定把它写成“Backbone and Marionette”,这样更好:(
-
投反对票的原因可能是因为这不是编程问题。还有很多其他的东西需要修剪。
-
谢谢。下次我会更小心的。我将编辑帖子并添加代码。
标签: backbone.js underscore.js marionette lodash