mirror of
https://github.com/zoriya/flood.git
synced 2026-05-31 02:15:12 +00:00
Debounce #setTorrentSearchFilter
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
import axios from 'axios';
|
||||
import _ from 'lodash';
|
||||
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import TorrentStore from '../stores/TorrentStore';
|
||||
|
||||
let UIActions = {
|
||||
displayContextMenu: (data) => {
|
||||
displayContextMenu: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_DISPLAY_CONTEXT_MENU,
|
||||
data
|
||||
});
|
||||
},
|
||||
|
||||
displayDropdownMenu: (data) => {
|
||||
displayDropdownMenu: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_DISPLAY_DROPDOWN_MENU,
|
||||
data
|
||||
});
|
||||
},
|
||||
|
||||
displayModal: (data) => {
|
||||
displayModal: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_DISPLAY_MODAL,
|
||||
data
|
||||
@@ -40,49 +40,53 @@ let UIActions = {
|
||||
});
|
||||
},
|
||||
|
||||
handleDetailsClick: (data) => {
|
||||
handleDetailsClick: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_CLICK_TORRENT_DETAILS,
|
||||
data
|
||||
});
|
||||
},
|
||||
|
||||
handleTorrentClick: (data) => {
|
||||
handleTorrentClick: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_CLICK_TORRENT,
|
||||
data
|
||||
});
|
||||
},
|
||||
|
||||
setTorrentStatusFilter: (data) => {
|
||||
setTorrentStatusFilter: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_SET_TORRENT_STATUS_FILTER,
|
||||
data
|
||||
});
|
||||
},
|
||||
|
||||
setTorrentTagFilter: (data) => {
|
||||
setTorrentTagFilter: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_SET_TORRENT_TAG_FILTER,
|
||||
data
|
||||
});
|
||||
},
|
||||
|
||||
setTorrentTrackerFilter: (data) => {
|
||||
setTorrentTrackerFilter: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_SET_TORRENT_TRACKER_FILTER,
|
||||
data
|
||||
});
|
||||
},
|
||||
|
||||
setTorrentsSearchFilter: (data) => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_SET_TORRENT_SEARCH_FILTER,
|
||||
data
|
||||
});
|
||||
},
|
||||
setTorrentsSearchFilter: _.debounce(
|
||||
data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_SET_TORRENT_SEARCH_FILTER,
|
||||
data
|
||||
});
|
||||
},
|
||||
250,
|
||||
{trailing: true}
|
||||
),
|
||||
|
||||
setTorrentsSort: (data) => {
|
||||
setTorrentsSort: data => {
|
||||
AppDispatcher.dispatchUIAction({
|
||||
type: ActionTypes.UI_SET_TORRENT_SORT,
|
||||
data
|
||||
|
||||
Reference in New Issue
Block a user