Skip to content

Commit 58d9282

Browse files
committed
Merge pull request #37 from aspidites/fix-example
Updated readme code to a working example.
2 parents ce70237 + fcf7911 commit 58d9282

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/slamdata/purescript-affjax.svg?branch=master)](https://travis-ci.org/slamdata/purescript-affjax)
44

5-
An library taking advantage of [`purescript-aff`](https://github.com/slamdata/purescript-aff) to enable pain-free asynchronous AJAX requests and response handling.
5+
A library taking advantage of [`purescript-aff`](https://github.com/slamdata/purescript-aff) to enable pain-free asynchronous AJAX requests and response handling.
66

77
# Getting Started
88

@@ -19,7 +19,7 @@ You can construct requests with the `affjax` function:
1919
```purescript
2020
main = launchAff $ do
2121
res <- affjax $ defaultRequest { url = "/api", method = GET }
22-
liftEff $ trace $ "GET /api response: " ++ res.response
22+
liftEff $ log $ "GET /api response: " ++ res.response
2323
```
2424

2525
(`defaultRequest` is a record value that has all the required fields pre-set for convenient overriding when making a request.)
@@ -29,10 +29,10 @@ Or use of a number of helpers for common cases:
2929
```purescript
3030
main = launchAff $ do
3131
res1 <- get "/api"
32-
liftEff $ trace $ "GET /api response: " ++ res1.response
32+
liftEff $ log $ "GET /api response: " ++ res1.response
3333
3434
res2 <- post "/api" someData
35-
liftEff $ trace $ "POST /api response: " ++ res2.response
35+
liftEff $ log $ "POST /api response: " ++ res2.response
3636
```
3737

3838
See the module documentation for a [full list of these helpers](docs/Network.HTTP.Affjax.md#get).

0 commit comments

Comments
 (0)