Skip to content

Commit

Permalink
Introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Aug 12, 2018
1 parent 5739ecc commit 5650784
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Examples:

## <a id="contents"></a> [](#contents) [](https://calmm-js.github.io/karet.xhr/index.html#contents) [Contents](#contents)

* [Introduction](#introduction)
* [Reference](#reference)
* [Convenience](#convenience)
* [`XHR.getJson(url | {url[, ...]}) ~> varies`](#XHR-getJson)
Expand Down Expand Up @@ -72,6 +73,32 @@ Examples:
* [Auxiliary](#auxiliary)
* [`XHR.isHttpSuccess(number) ~> boolean`](#XHR-isHttpSuccess)

## <a id="introduction"></a> [](#contents) [](https://calmm-js.github.io/karet.xhr/index.html#introduction) [Introduction](#introduction)

To-Be-Done

```js
const searchRepositories = q => XHR.performJson(
U.string`https://api.github.com/search/repositories?q=${U.encodeURIComponent(q)}&sort=stars&order=desc`
)

const logValues = observable => {
const value = console.log
setTimeout(() => U.on({value}, observable), 0)
}

const xhr = searchRepositories('karet')

logValues(U.string`${XHR.downLoaded(xhr)} bytes loaded`)
logValues(
L.collectAs(
({full_name, stargazers_count}) => `${stargazers_count} ${full_name}`,
L.flat('items'),
XHR.responseFull(xhr)
)
)
```

## <a id="reference"></a> [](#contents) [](https://calmm-js.github.io/karet.xhr/index.html#reference) [Reference](#reference)

The interface of this library consists of named exports. Typically one just
Expand Down
1 change: 1 addition & 0 deletions docs/setup.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
window.L = window.Kefir.partial.lenses
window.U = window.karet.util
window.XHR = window.karet.xhr
9 changes: 7 additions & 2 deletions klipse-github-docs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
'https://unpkg.com/partial.lenses/dist/partial.lenses.js',
'https://unpkg.com/partial.lenses.validation/dist/partial.lenses.validation.js',
'https://unpkg.com/kefir/dist/kefir.js',
'https://unpkg.com/react/umd/react.production.min.js',
'https://unpkg.com/karet/dist/karet.js',
'https://unpkg.com/karet.lift/dist/karet.lift.js',
'https://unpkg.com/kefir.partial.lenses/dist/kefir.partial.lenses.js',
'karet.xhr.js',
'setup.js',
'https://unpkg.com/ramda/dist/ramda.min.js'
'https://unpkg.com/kefir.atom/dist/kefir.atom.js',
'https://unpkg.com/kefir.combines/dist/kefir.combines.js',
'https://unpkg.com/karet.util/dist/karet.util.js',
'https://unpkg.com/ramda/dist/ramda.min.js',
'setup.js'
],
source: 'README.md',
target: 'index.html',
Expand Down

0 comments on commit 5650784

Please sign in to comment.