Skip to content

Commit

Permalink
Merge pull request #41 from muralco/fix/create-app-return-type
Browse files Browse the repository at this point in the history
Fix `createApp` return type
  • Loading branch information
nicolapalavecino authored Aug 31, 2023
2 parents 90411e2 + 7921ba9 commit ace9b4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "async-app",
"version": "4.8.0",
"version": "4.8.1",
"description": "An express wrapper for handling async middlewares, order middlewares, schema validator, and other stuff",
"type": "commonjs",
"main": "dist/index.js",
Expand Down
11 changes: 7 additions & 4 deletions src/create-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ const asyncAppProvider: AppProvider = <

let appProvider: AppProvider<any, any> = asyncAppProvider;

export const resetProvider = () => (appProvider = asyncAppProvider);
export const resetProvider = () => {
appProvider = asyncAppProvider;
};

export const setProvider = (provider: AppProvider<any, any>) =>
(appProvider = provider);
export const setProvider = (provider: AppProvider<any, any>) => {
appProvider = provider;
};

export const createApp = <TEntities extends Entities = Entities, TSchema = {}>(
opts?: Opts<TEntities, TSchema>,
) => appProvider(opts);
): App<TEntities, TSchema> => appProvider(opts);

export default createApp;

0 comments on commit ace9b4f

Please sign in to comment.