chore: update the version and add the setupInit section

This commit is contained in:
BluJ
2023-04-25 14:36:43 -06:00
parent 5107d38547
commit 1b9e2cf503
11 changed files with 155 additions and 58 deletions

View File

@@ -17,7 +17,7 @@ export type Save<WD, A> = (options: {
export type Read<WD, A> = (options: {
effects: Effects;
utils: Utils<WD>;
}) => Promise<null | DeepPartial<A>>;
}) => Promise<void | DeepPartial<A>>;
/**
* We want to setup a config export with a get and set, this
* is going to be the default helper to setup config, because it will help
@@ -46,7 +46,9 @@ export function setupConfig<WD, A extends Config<InputSpec>>(
getConfig: (async ({ effects, config }) => {
return {
spec: spec.build(),
config: nullIfEmpty(await read({ effects, utils: utils<WD>(effects) })),
config: nullIfEmpty(
(await read({ effects, utils: utils<WD>(effects) })) || null,
),
};
}) as ExpectedExports.getConfig,
};