Skip to content

Commit

Permalink
refactor: set context as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed May 23, 2023
1 parent 99ae71a commit e04fdba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import storageModule from "./module.js";
export default function (args: {
app: string;
storageOptions: CreateStorageOptions;
contextOptions: CreateStorageOptions;
contextOptions?: CreateStorageOptions;
}) {
const module = storageModule({ app: args.app, options: args.storageOptions });

return {
storageModule: module,
contextStore: () =>
contextStore({ app: args.app, options: args.contextOptions }),
contextStore:
args.contextOptions &&
(() => contextStore({ app: args.app, options: args.contextOptions })),
};
}

0 comments on commit e04fdba

Please sign in to comment.