Skip to content

Commit b4476b5

Browse files
committed
chore: update readme.md
1 parent b92b62f commit b4476b5

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yme/api",
3-
"description": "Simply create some standalone functions",
3+
"description": "Simply create some request functions",
44
"version": "0.0.0-development",
55
"type": "module",
66
"sideEffects": false,

packages/api/readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ npm install @yme/api
3030
Use `ApiClient` with `fetch` (Action first)
3131

3232
```ts
33-
import { ApiClient, replacePathParams } from "@yme/api/client";
33+
import { createClient, replacePathParams } from "@yme/api/client";
3434
import { logger } from "@yme/api/middleware";
3535

36-
const api = new ApiClient({
36+
const api = createClient({
3737
action: async ({ req }) => {
3838
// make http request and return data
3939
const response = await fetch(req.url, {
@@ -80,8 +80,8 @@ const newUserId = await createUser(
8080
Use `NextAction` for Next.js server action (Action last)
8181

8282
```ts
83-
import { NextAction } from "@yme/api/next";
84-
const api = new NextAction({
83+
import { createAction } from "@yme/api/next";
84+
const api = createAction({
8585
middlewares: [],
8686
// throwing an error will make the server return status 500
8787
// we can handle it in the error handler. e.g. returns a fallback data with error message

readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ npm install @yme/api
3030
Use `ApiClient` with `fetch` (Action first)
3131

3232
```ts
33-
import { ApiClient, replacePathParams } from "@yme/api/client";
33+
import { createClient, replacePathParams } from "@yme/api/client";
3434
import { logger } from "@yme/api/middleware";
3535

36-
const api = new ApiClient({
36+
const api = createClient({
3737
action: async ({ req }) => {
3838
// make http request and return data
3939
const response = await fetch(req.url, {
@@ -80,8 +80,8 @@ const newUserId = await createUser(
8080
Use `NextAction` for Next.js server action (Action last)
8181

8282
```ts
83-
import { NextAction } from "@yme/api/next";
84-
const api = new NextAction({
83+
import { createAction } from "@yme/api/next";
84+
const api = createAction({
8585
middlewares: [],
8686
// throwing an error will make the server return status 500
8787
// we can handle it in the error handler. e.g. returns a fallback data with error message

0 commit comments

Comments
 (0)