Commit 765cca93 authored by lauraMon's avatar lauraMon

Replaces underscore with lodash in ds

parent 3cf78b50
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