d3/d3-queue

Uncaught TypeError: Object #<Object> has no method 'apply'

zzart opened this issue · 1 comments

Hi, thanks for you superb lib! I have a question though. Im trying to do an async call and fetch some data from the server. But i keep getting Uncaught TypeError: Object # has no method 'apply' and can't really work out what to do with it...

#this code works as expected when doing just one call to the server , 
# things start to get messy when need to loop through dep.client array 
# to perform a couple calls in a row 

  refresh_model: (some_param) =>
        params = {}
        params['some_param'] = some_param
        @model = new Model
        @model.fetch
              data: params
              success: =>
                console.log(@model)


    refresh_dependencies: (model) =>
        dep =
            client: [
                'some_param'
                'some_param'
            ]       
        self = @    
        q = queue(1)
        dep.client.forEach (t) ->
            q.defer(self.refresh_model(t))

Sorry wasn't aware about the whole callback stuff. I've solved it.