Skip to content

Commit

Permalink
feat(utils): Add the uniqueId method
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoli committed Dec 14, 2018
1 parent 9835659 commit 03d56e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/Base/Editor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import G6Editor from '@antv/g6-editor';
import { createId } from '@utils';
import { uniqueId } from '@utils';
import Global from '@common/Global';

export default class Editor extends G6Editor {
Expand All @@ -16,6 +16,6 @@ export default class Editor extends G6Editor {
G6Editor.track(false);
}

this.id = createId();
this.id = uniqueId();
}
}
8 changes: 3 additions & 5 deletions src/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import pick from 'lodash/pick';
import merge from 'lodash/merge';
import pick from 'lodash/pick';
import uniqueId from 'lodash/uniqueId';
import upperFirst from 'lodash/upperFirst';

const createCounter = (count = 0) => () => count++;
const createId = createCounter();

export {
createId,
merge,
pick,
uniqueId,
upperFirst,
};

0 comments on commit 03d56e7

Please sign in to comment.