File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
packages/react-intlayer/src Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const createSuspender = <T>(promise: Promise<T>) => {
25
25
26
26
const cache = new Map < string , ReturnType < typeof createSuspender > > ( ) ;
27
27
28
- export const useLoadDynamic = < T > ( key : string , promise : Promise < T > ) => {
28
+ export const useLoadDynamic = < T > ( key : string , promise : Promise < T > ) : T => {
29
29
if ( ! cache . has ( key ) ) {
30
30
cache . set ( key , createSuspender ( promise ) ) ;
31
31
}
Original file line number Diff line number Diff line change 1
1
import { cache , use } from 'react' ;
2
2
3
- export const useLoadDynamic = < T > ( _key : string , promise : Promise < T > ) => {
3
+ export const useLoadDynamic = < T > ( _key : string , promise : Promise < T > ) : T => {
4
4
const cachedPromise = cache ( async ( ) => await promise ) ( ) ;
5
5
6
6
const dictionary = use ( cachedPromise ) ;
You can’t perform that action at this time.
0 commit comments