---
# System prepended metadata

title: RxJS 問題請教

---

# RxJS 問題請教

```
http://localhost:3000/books
```

API 回傳如下：

```
[
  {
    "id": 1,
    "title": "FP in JavaScript",
    "price": 100,
    "categoryId": 1
  },
  {
    "id": 2,
    "title": "RxJS in Action",
    "price": 200,
    "categoryId": 2
  },
  {
    "id": 3,
    "title": "Speaking JavaScript",
    "price": 300,
    "categoryId": 3
  }
]
```

目前只有 `categoryId`，必須另外呼叫另外一個 API 回傳 `category`

如：

```
http://localhost:3000/categories/1
```

回傳

```
{
  "key": 1,
  "value": "FP"
}
```

希望最後結果為：

```
[
  {
    "id": 1,
    "title": "FP in JavaScript",
    "price": 100,
    "category": "FP"
  },
  {
    "id": 2,
    "title": "RxJS in Action",
    "price": 200,
    "category": "FRP"
  },
  {
    "id": 3,
    "title": "Speaking JavaScript",
    "price": 300,
    "category": "JS"
  }
]
```
