javascript - swap underscore 1.8.3 for lodash 4.2.1 in backbone marionette 2.4.4 -


is possible? keep reading conflicting reports on this.

i have marionette app, upgraded 2.4.4.

if drop in lodash in place of underscore - using requirejs,

 map: {   '*': {     'underscore': 'lodash'   } },  //  'underscore':'/resource/vendor/backbone.marionette/underscore', 'lodash':'/resource/vendor/lodash/lodash.min', 

i following error...

uncaught typeerror: cannot read property 'vent' of undefined 

lodash loading ok, marionette complaining.

it appears context this on line 466 undefined

 463 _proxymethods: function() {  464     _.each([ "vent", "commands", "reqres" ], function(system) {  465       _.each(messagesystems[system], function(method) {  466         this[system][method] = proxymethod(this, system, method);  467       }, this);  468     }, this);  469   } 

any advice?

for else looking @ this, answer no.

lodash 3.10.1 fine, 4.x release has removed context option many of functions, breaks marionette.

the old way

    _.each(collection, iteratee, context); 

the new way is

_.each(collection, _.bind(iteratee, context)); 

but far using 3.10.1 above requirejs set up.

so until marionette updated, have hold off on 4.x


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -