Skip to content

Commit 0559dca

Browse files
committed
fix: return function instead of promise from withUniwindConfig
1 parent a58aa89 commit 0559dca

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/uniwind/src/metro/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ type UniwindConfig = {
1111
polyfills?: Polyfills
1212
}
1313

14-
export declare function withUniwindConfig(config: MetroConfig, options: UniwindConfig): Promise<MetroConfig>
14+
export declare function withUniwindConfig(config: MetroConfig, options: UniwindConfig): () => Promise<MetroConfig>

packages/uniwind/src/metro/withUniwindConfig.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ const getPlatformFromVirtualPath = (path: string) => {
2020

2121
const platforms = [Platform.iOS, Platform.Android, Platform.Web]
2222

23-
export const withUniwindConfig = async (
23+
export const withUniwindConfig = (
2424
config: MetroConfig,
2525
uniwindConfig: UniwindConfig,
26-
): Promise<MetroConfig> => {
26+
) =>
27+
async (): Promise<MetroConfig> => {
2728
if (!fs.existsSync(cacheDir)) {
2829
fs.mkdirSync(cacheDir)
2930
}

0 commit comments

Comments
 (0)