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 = { subscription = {
scope: scope, scope: scope,
routingKey: routingKey, routingKey: routingKey,
callback: _.debounce(callback, 500, {"leading": true, "trailing": false}) callback: callback
} }
message = { message = {

View File

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