Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
replace lodash uniqueId
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Apr 20, 2023
1 parent 6c43bb4 commit aae32f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/js/base/context/event-emit/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ import {
EventObserversType,
} from './types';

export function generateUniqueId() {
return Math.floor( Math.random() * Date.now() ).toString();
}

export const actions = {
addEventCallback: (
eventType: string,
callback: ActionCallbackType,
priority = 10
): ActionType => {
return {
id: uniqueId(),
id: generateUniqueId(),
type: ACTION.ADD_EVENT_CALLBACK,
eventType,
callback,
Expand Down

0 comments on commit aae32f2

Please sign in to comment.