Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette authored Aug 13, 2024
1 parent b0c660e commit 7a7f677
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const [error, data] ?= obj

```ts
function action() {
return [null, 'data']
return 'data'
}

const [error, data] ?= action(argument)
Expand All @@ -180,7 +180,7 @@ const [error, data] ?= action(argument1, argument2, ...)
If the `?=` operator is used in an object, nothing is passed to the `Symbol.result` method as parameters.

```ts
declare const obj: { [Symbol.result]: unknown }
declare const obj: { [Symbol.result]: () => any }

const [error, data] ?= obj
// const [error, data] = obj[Symbol.result]()
Expand Down

0 comments on commit 7a7f677

Please sign in to comment.