Skip to content

Instantly share code, notes, and snippets.

@aaitken
Created April 17, 2012 16:52
Show Gist options
  • Save aaitken/2407446 to your computer and use it in GitHub Desktop.
Save aaitken/2407446 to your computer and use it in GitHub Desktop.
require [
#data
'models/options'
'models/ui'
#thin models
'models/optionsOptions'
'models/optionsClubHead'
'models/optionsGrip'
'models/optionsShaft'
'models/optionsLengthWrap'
'models/uiConfigurations'
'models/uiPresentation'
#cross-model
'shared/getOptionIDs'
#views
'views/share'
'views/config'
'views/configClubHead'
'views/configShaft'
'views/configGrip'
'views/configLengthWrap'
'views/saveAdd'
'views/configViewCompare'
'views/views'
'views/selectedOptions'
'views/stage'
], ->
args = arguments
#or parallel assignment...
$.when(args[0].singleton().deferred, args[1].singleton().deferred).done ->
_.each args, (item) ->
if item.singleton then item.singleton()
@jtrim
Copy link

jtrim commented Apr 17, 2012

Cool. Definitely much cleaner. The only remaining critique I could give is the use of args[0] and args[1] directly. You could do this and achieve a bit more clarity: https://gist.github.com/2407480

@jtrim
Copy link

jtrim commented Apr 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment