Skip to content

Commit b4de64a

Browse files
blog: review and social
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
1 parent e13049f commit b4de64a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

109 KB
Loading

blog/2026-03-16-custom-functions-in-typescript/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ title: Custom Functions in TypeScript
44
authors: [peterpeterparker]
55
tags: [functions, typescript, sputnik, serverless]
66
date: 2026-03-16
7+
image: https://juno.build/assets/images/custom-functions-in-typescript-snippet-11baea283d0c73597d0f4a159eb4ad7d.png
78
---
89

9-
For many use cases, frontend code gets you far. But even in smaller projects, you quickly hit a point where you need some backend logic. That's where serverless functions come in.
10+
![](custom-functions-in-typescript-snippet.png)
1011

11-
The idea behind Juno's functions is that you should be able to write them in either Rust or TypeScript. Hooks have been available in TypeScript for a while and are handy for reacting to events. But developers also often want to define their own functions, query or update, akin to adding custom endpoints to an HTTP API. That wasn't supported in TypeScript, until now 🚀.
12+
The idea behind Juno's serverless functions is that you should be able to write them in either Rust or TypeScript following the same pattern and mental model. Parts of those, hooks, have been available in TypeScript for a while and are handy for reacting to events. But developers also often want to define their own functions, akin to adding custom endpoints to an HTTP API. That wasn't supported in TypeScript, until now 🚀.
1213

1314
---
1415

@@ -20,7 +21,7 @@ There are two kinds.
2021

2122
A **query** is read-only. It returns data without touching any state, and it's fast. Use it when you just need to fetch something.
2223

23-
An **update** can read and write. Use it when your logic needs to persist data, trigger side effects, or when you need the response to be certified, making it suitable for security-sensitive use cases where data integrity must be guaranteed.
24+
An **update** can read and write. Use it when your logic needs to persist data, trigger side effects, or when you need an absolute tamper-proof guarantee on the result.
2425

2526
```typescript
2627
import { defineQuery } from "@junobuild/functions";

0 commit comments

Comments
 (0)