Skip to content

Commit

Permalink
docs: Adding more helpful comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeesha committed Dec 16, 2023
1 parent f34a317 commit e927ea9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/example-1-simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import process from "process";
// via generics. you can pass in any serializable arguments you
// want, and accept any serializable return value you want.
//
// try changing the type of the argument to "hello" to a number,
// to see the type-safety in action.
//
// this function will be served by the helloService
const greeting = await d.call<typeof helloService, "hello">(
"hello",
Expand Down
5 changes: 5 additions & 0 deletions src/example-2-complex.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { d } from "./d";
import type { crawlerService } from "./services/crawler-service";

// this is a more complex example, where we call a service that
// returns a complex object.
//
// the crawlerService.getImages is a function crawling a website
// and returning a list of images that it found on the page.
(async function () {
const images = await d.call<typeof crawlerService, "getImages">(
"getImages",
Expand Down

0 comments on commit e927ea9

Please sign in to comment.