Skip to content

Commit d2c1041

Browse files
committed
Update README FFI example with 0.7 style FFI
1 parent d7a782d commit d2c1041

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ This function expects you to provide a handler, which should call a user-supplie
5353

5454
For example, let's say we have an AJAX request function that expects a callback:
5555

56-
```purescript
57-
foreign import ajaxGet """
58-
function ajaxGet(callback) { // accepts a callback
56+
```javascript
57+
exports.ajaxGet = function(callback) { // accepts a callback
5958
return function(request) { // and a request
6059
return function() { // returns an effect
6160
doNativeRequest(request, function(response) {
@@ -64,7 +63,10 @@ function ajaxGet(callback) { // accepts a callback
6463
}
6564
}
6665
}
67-
""" :: forall e. (Response -> Eff e Unit) -> Request -> Eff e Unit
66+
```
67+
68+
```purescript
69+
foreign import ajaxGet :: forall e. (Response -> Eff e Unit) -> Request -> Eff e Unit
6870
```
6971

7072
We can wrap this into an asynchronous computation like so:

0 commit comments

Comments
 (0)