Skip to content

Commit

Permalink
Use Parameters and indexed access type to extract PreloadParams
Browse files Browse the repository at this point in the history
Reviewed By: gkz

Differential Revision: D52335263

fbshipit-source-id: bf3506d0472c2a1cc239110eff614f7220359d42
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Dec 20, 2023
1 parent 5cf0af1 commit 1a06f32
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/react-relay/relay-hooks/EntryPointTypes.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,7 @@ export type EntryPoint<TEntryPointParams, +TEntryPointComponent> =
ElementConfig<TEntryPointComponent>['extraProps'],
>;

type ExtractFirstParam = <P, R>((P) => R) => P;
type GetPreloadPropsType<T> = T['getPreloadProps'];
// $FlowFixMe[deprecated-type]
export type PreloadParamsOf<T> = $Call<
ExtractFirstParam,
GetPreloadPropsType<T>,
>;
export type PreloadParamsOf<T> = Parameters<T['getPreloadProps']>[0];

export type IEnvironmentProvider<TOptions> = {
getEnvironment: (options: ?TOptions) => IEnvironment,
Expand Down

0 comments on commit 1a06f32

Please sign in to comment.