From ba481f6293687434ab8a83a23e1bbe1e5a75741a Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Sun, 5 Mar 2023 20:53:22 -0600 Subject: [PATCH] docs(store): better `MethodGuardMaker` example --- packages/store/src/types.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/store/src/types.js b/packages/store/src/types.js index 7f2e84875b61..1c559b21ccd2 100644 --- a/packages/store/src/types.js +++ b/packages/store/src/types.js @@ -753,10 +753,17 @@ /** * @typedef {any} MethodGuardMaker - * a parameter list like foo(a, b, c = d, …e) => f should be guarded by - * something like - * foo: M.call(AShape, BShape).optional(CShape).rest(EShape).returns(FShape) - * optional is for optional (=) params. rest is for … (varargs) params + * A method name and parameter/return signature like: + * ```js + * foo(a, b, c = d, ...e) => f + * ``` + * should be guarded by something like: + * ```js + * { + * ...otherMethodGuards, + * foo: M.call(AShape, BShape).optional(CShape).rest(EShape).returns(FShape), + * } + * ``` */ /** @typedef {{ klass: 'methodGuard', callKind: 'sync' | 'async', returnGuard: unknown }} MethodGuard */