Skip to content

Commit

Permalink
improved readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Inalegwu committed Sep 17, 2024
1 parent 26fdab7 commit a764a25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ const increment=(v:number)=>v+1;
const res=safeDivide(1/2).andThen()
```

### Importing Third-Party Code
```ts
import {makeSafeFunc} from "@disgruntleddevs/make-safe-func";
import {someLibraryFunction} from "@third-party/library";

const safeLibraryFunction=makeSafeFunc(someLibraryFunction);

const result=safeLibraryFunction(params,for,func).unwrapOr("default value")

console.log(result);
```

<i>The MakeSafeFunc docs are sparse because most of it's power is derived from
[neverthrow](https://github.com/supermacro/neverthrow) so the docs for neverthrow
will be your friend.
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@disgruntleddevs/make-safe-func",
"description": "Finally be sure your functions don't throw",
"license": "MIT",
"version": "0.1.0",
"version": "0.1.1",
"exports": "./src/index.ts",
"tasks": {
"dev": "deno run --watch main.ts"
Expand Down

0 comments on commit a764a25

Please sign in to comment.