feat: Revamp navigation bar (#6031)
closes: #4428 Testing for fetchMoreRecords is pending, along with component tests --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
12
packages/twenty-front/src/utils/createEventContext.ts
Normal file
12
packages/twenty-front/src/utils/createEventContext.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { Context, createContext } from 'react';
|
||||
|
||||
type ObjectOfFunctions = {
|
||||
[key: string]: (...args: any[]) => void;
|
||||
};
|
||||
|
||||
export type EventContext<T extends ObjectOfFunctions> =
|
||||
T extends ObjectOfFunctions ? T : never;
|
||||
|
||||
export const createEventContext = <T extends ObjectOfFunctions>(): Context<
|
||||
EventContext<T>
|
||||
> => createContext<EventContext<T>>({} as EventContext<T>);
|
||||
Reference in New Issue
Block a user