Commit 833157a3 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'lm-replace-dirty-submit' into 'master'

Replaces underscore with lodash in javascripts/dirty_submit

See merge request gitlab-org/gitlab!28386
parents df701b16 765cca93
import _ from 'underscore'; import { memoize, throttle } from 'lodash';
import $ from 'jquery'; import $ from 'jquery';
class DirtySubmitForm { class DirtySubmitForm {
...@@ -21,8 +21,8 @@ class DirtySubmitForm { ...@@ -21,8 +21,8 @@ class DirtySubmitForm {
} }
registerListeners() { registerListeners() {
const getThrottledHandlerForInput = _.memoize(() => const getThrottledHandlerForInput = memoize(() =>
_.throttle(event => this.updateDirtyInput(event), DirtySubmitForm.THROTTLE_DURATION), throttle(event => this.updateDirtyInput(event), DirtySubmitForm.THROTTLE_DURATION),
); );
const throttledUpdateDirtyInput = event => { const throttledUpdateDirtyInput = event => {
......
...@@ -70,6 +70,7 @@ describe('DirtySubmitForm', () => { ...@@ -70,6 +70,7 @@ describe('DirtySubmitForm', () => {
describe('throttling tests', () => { describe('throttling tests', () => {
beforeEach(() => { beforeEach(() => {
jasmine.clock().install(); jasmine.clock().install();
jasmine.clock().mockDate();
DirtySubmitForm.THROTTLE_DURATION = 100; DirtySubmitForm.THROTTLE_DURATION = 100;
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment