Skip to content

Commit

Permalink
docs(api): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Jun 10, 2017
1 parent 5da84f1 commit 88d2ada
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions API.md
Expand Up @@ -9,12 +9,15 @@
- [forEach](#forEach)
- [Sources](#sources)
- [create](#create)
- [empty](#empty)
- [frames](#frames)
- [fromArray](#fromArray)
- [fromDOM](#fromDOM)
- [fromPromise](#fromPromise)
- [interval](#interval)
- [of](#of)
- [just](#just)
- [never](#never)

- [Operators](#operators)
- [delay](#delay)
- [filter](#filter)
Expand Down Expand Up @@ -186,6 +189,12 @@ const $ = O.create((observer, scheduler) =>
O.forEach(console.log, $)
```

## empty

```ts
function empty(): Observable
```
Creates an observable that completes without emitting any value.

## frames

Expand Down Expand Up @@ -268,20 +277,28 @@ Fires an event on every given `duration` amount of time.
const $ = O.interval(1000) // fires in every 1000ms
```


## of
## just

```ts
function of(...t: any[]): Observable
function just(value: any): Observable
```

Its essentially a syntactic sugar over `O.fromArray()` as it emits all the arguments that are passed to the function.
Creates an observable that emits only one value

**Example:**
```ts
const $ = O.of('A', 'B', 'C') // emits 'A' then 'B' and then 'C'
const $ = O.just('AIR')
O.forEach(console.log, $) // logs `AIR`
```

## never

```ts
function never(): Observable
```

Creates an observable that never completes.

# Operators
These are functions that take in one or more streams as arguments and returns a another stream as a result. For Eg`map(x => x + 1, a$)`. Here `map` takes in an *iterator* that increments each value emitted in the stream `a$` and returns a new stream containing the incremented values.

Expand Down Expand Up @@ -654,4 +671,4 @@ toMarble([
*/
```
```

0 comments on commit 88d2ada

Please sign in to comment.