Debounce load US's

stable
Álex Hermida 2018-06-25 15:01:19 +02:00 committed by Miguel Gonzalez
parent dc23c424b0
commit 3fff575c22
2 changed files with 4 additions and 3 deletions

View File

@ -204,7 +204,7 @@ class EventsService
subscription = {
scope: scope,
routingKey: routingKey,
callback: _.debounce(callback, 500, {"leading": true, "trailing": false})
callback: callback
}
message = {

View File

@ -31,6 +31,7 @@ bindOnce = @.taiga.bindOnce
groupBy = @.taiga.groupBy
timeout = @.taiga.timeout
bindMethods = @.taiga.bindMethods
debounceLeading = @.taiga.debounceLeading
module = angular.module("taigaKanban")
@ -342,8 +343,8 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
initializeSubscription: ->
routingKey1 = "changes.project.#{@scope.projectId}.userstories"
@events.subscribe @scope, routingKey1, (message) =>
@.loadUserstories()
@events.subscribe @scope, routingKey1, debounceLeading(300, (message) =>
@.loadUserstories())
loadInitialData: ->
project = @.loadProject()