From b56dcd06391814f7eca4d6fc8ce51d80c80d40d7 Mon Sep 17 00:00:00 2001 From: Anton Nesterov Date: Thu, 17 Oct 2024 06:08:22 +0200 Subject: [PATCH] update readm --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3abbf73..5e338a2 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ Simplified result/error handling for JavaScript. Grip always returns a consistent call result ready to be handled. It makes the control flow similar to that of Golang, but doesn't force you to make additional null checks or create transitional variables to hold error results. -Instead of returning an nullish Error, Grip always returns a Status object: +Instead of returning a nullish error, Grip always returns a consistent status object: ```javascript const [value, status] = grip(callable) -if (status.Fail()) { - // handle any error -} if (status.Of(MySpecificError)) { // handle specific error } +if (status.Fail()) { + // handle any error +} ``` The call result is better than tuple: