Skip to content

Commit d8eba6b

Browse files
committed
📃 docs(README): Adjust code formatting
1 parent 8281fde commit d8eba6b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,20 @@ const askCurrentUser = dependency("currentUser")<User | null>;
6969
const authenticationError = error("authentication");
7070
const unauthorizedError = error("unauthorized");
7171

72-
// prettier-ignore
7372
const requiresAdmin = () => effected(function* () {
7473
const currentUser = yield* askCurrentUser();
7574
if (!currentUser) return yield* authenticationError();
7675
if (currentUser.role !== "admin")
7776
return yield* unauthorizedError(`User "${currentUser.name}" is not an admin`);
7877
});
7978

80-
// prettier-ignore
8179
const createUser = (user: Omit<User, "id">) => effected(function* () {
8280
yield* requiresAdmin();
8381
const id = yield* executeSQL("INSERT INTO users (name) VALUES (?)", user.name);
8482
const savedUser: User = { id, ...user };
8583
yield* println("User created:", savedUser);
8684
return savedUser;
87-
});
85+
});
8886
```
8987

9088
The code above defines five effects: `println`, `executeSQL`, `currentUser`, `authentication`, and `unauthorized`. Effects can be defined using `effect`, with `dependency` and `error` as wrappers for specific purposes.

0 commit comments

Comments
 (0)