Description
We lack a promise schema builder that will be resolved to a Promise<T> type.
Make sure you:
- follow best practices we have in the project
- Add comprehensive JSDoc comments
- Update
.changeset
- Update README.md files
- Update website accordingly with playground
- don't forget to add unit tests and type test for every unit test.
Motivation / Use Case
Will be useful in a lot of cases. E.g. to define a function which returns promise as result.
Proposed API
import { promise, string } from '@cleverbrush/schema';
const PromiseResult = promise(string());
// PromiseResultType ==> Promise
type PromiseResultType = InferType;
Package
@cleverbrush/schema
Alternatives Considered
No response
Description
We lack a promise schema builder that will be resolved to a
Promise<T>type.Make sure you:
.changesetMotivation / Use Case
Will be useful in a lot of cases. E.g. to define a function which returns promise as result.
Proposed API
import { promise, string } from '@cleverbrush/schema';
const PromiseResult = promise(string());
// PromiseResultType ==> Promise
type PromiseResultType = InferType;
Package
@cleverbrush/schema
Alternatives Considered
No response