Skip to content

Commit

Permalink
Merge pull request #144 from GooseNinja/master
Browse files Browse the repository at this point in the history
Markdown fixes in the README.md file.
  • Loading branch information
paldepind authored Apr 19, 2017
2 parents 6ba68ff + eb43727 commit 8e78338
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ var max = flyd.combine(function(n1, n2, self, changed) {
}, [n1, n2]);
```

###flyd.isStream(stream)
### flyd.isStream(stream)

Returns `true` if the supplied argument is a Flyd stream and `false` otherwise.

Expand All @@ -368,7 +368,7 @@ flyd.isStream(s); //=> true
flyd.isStream(n); //=> false
```

###flyd.immediate(stream)
### flyd.immediate(stream)

By default the body of a dependent stream is only called when all the streams
upon which it depends has a value. `immediate` can circumvent this behaviour.
Expand All @@ -393,7 +393,7 @@ s([]);
console.log(hasItems()); // logs `false`.
```
###flyd.endsOn(endStream, s)
### flyd.endsOn(endStream, s)
Changes which `endsStream` should trigger the ending of `s`.
Expand All @@ -412,7 +412,7 @@ var double = flyd.endsOn(flyd.merge(n.end, killer), flyd.combine(function(n) {
}, [n]);
```
###flyd.map(fn, s)
### flyd.map(fn, s)
Returns a new stream consisting of every value from `s` passed through `fn`. I.e. `map` creates
a new stream that listens to `s` and applies `fn` to every new value.
Expand All @@ -427,7 +427,7 @@ var numbers = flyd.stream(0);
var squaredNumbers = flyd.map(function(n) { return n*n; }, numbers);
```
###flyd.on(fn, s)
### flyd.on(fn, s)
Similar to `map` except that the returned stream is empty. Use `on` for doing
side effects in reaction to stream changes. Use the returned stream only if you
Expand All @@ -443,7 +443,7 @@ var numbers = flyd.stream(0);
flyd.on(function(n) { console.log('numbers changed to', n); }, numbers);
```
###flyd.scan(fn, acc, stream)
### flyd.scan(fn, acc, stream)
Creates a new stream with the results of calling the function on every incoming
stream with and accumulator and the incoming value.
Expand All @@ -460,7 +460,7 @@ numbers(2)(3)(5);
sum(); // 10
```
###flyd.merge(stream1, stream2)
### flyd.merge(stream1, stream2)
Creates a new stream down which all values from both `stream1` and `stream2`
will be sent.
Expand Down Expand Up @@ -503,7 +503,7 @@ s1(1)(1)(2)(3)(3)(3)(4);
results; // [2, 4, 6, 8]
```
###flyd.curryN(n, fn)
### flyd.curryN(n, fn)
Returns `fn` curried to `n`. Use this function to curry functions exposed by
modules for Flyd.
Expand All @@ -520,7 +520,7 @@ flyd.curryN(2, add);
var add
```
###stream()
### stream()
Returns the last value of the stream.
Expand All @@ -535,7 +535,7 @@ var names = flyd.stream('Turing');
names(); // 'Turing'
```
###stream(val)
### stream(val)
Pushes a value down the stream.
Expand All @@ -550,12 +550,12 @@ names('Bohr');
names(); // 'Bohr'
```
###stream.end
### stream.end
A stream that emits `true` when the stream ends. If `true` is pushed down the
stream the parent stream ends.
###stream.map(f)
### stream.map(f)
Returns a new stream identical to the original except every
value will be passed through `f`.
Expand All @@ -574,7 +574,7 @@ var numbers = flyd.stream(0);
var squaredNumbers = numbers.map(function(n) { return n*n; });
```
###stream1.ap(stream2)
### stream1.ap(stream2)
`stream1` must be a stream of functions.
Expand All @@ -598,7 +598,7 @@ var addToNumbers1 = flyd.map(add, numbers1);
var added = addToNumbers1.ap(numbers2);
```
###stream.of(value)
### stream.of(value)
Returns a new stream with `value` as its initial value. It is identical to
calling `flyd.stream` with one argument.
Expand Down Expand Up @@ -721,8 +721,3 @@ npm test
The `npm test` command run three tests: a eslint js style checker test, the test of the core library and the test of the modules. If you want to run only the test of the library `npm run test`.
The API.md file is generated using `npm run docs` (it assumes it has documentation installed globally: `npm i -g documentation`)

0 comments on commit 8e78338

Please sign in to comment.