From eb437274acf6806bc3805546f2d5e04f645a9f11 Mon Sep 17 00:00:00 2001 From: Skuli Oskarsson Date: Wed, 19 Apr 2017 14:55:08 +0000 Subject: [PATCH] Made some minor markdown fixes in the README.md file. --- README.md | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 19347fc..be99b8c 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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. @@ -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`. @@ -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. @@ -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 @@ -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. @@ -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. @@ -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. @@ -520,7 +520,7 @@ flyd.curryN(2, add); var add ``` -###stream() +### stream() Returns the last value of the stream. @@ -535,7 +535,7 @@ var names = flyd.stream('Turing'); names(); // 'Turing' ``` -###stream(val) +### stream(val) Pushes a value down the stream. @@ -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`. @@ -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. @@ -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. @@ -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`) - - - - -