@cycle/core
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -7,8 +7,8 @@ | ||
### <a id="run"></a> `run(app, drivers)` | ||
### <a id="run"></a> `run(main, drivers)` | ||
Takes an `app` function and circularly connects it to the given collection | ||
Takes an `main` function and circularly connects it to the given collection | ||
of driver functions. | ||
The `app` function expects a collection of "driver response" Observables as | ||
The `main` function expects a collection of "driver response" Observables as | ||
input, and should return a collection of "driver request" Observables. | ||
@@ -21,3 +21,3 @@ A "collection of Observables" is a JavaScript object where | ||
- `app :: Function` a function that takes `responses` as input and outputs a collection of `requests` Observables. | ||
- `main :: Function` a function that takes `responses` as input and outputs a collection of `requests` Observables. | ||
- `drivers :: Object` an object where keys are driver names and values are driver functions. | ||
@@ -27,3 +27,3 @@ | ||
*(Array)* an array where the first object is the collection of driver requests, and the second objet is the collection of driver responses, that | ||
*(Array)* an array where the first object is the collection of driver requests, and the second object is the collection of driver responses, that | ||
can be used for debugging or testing. | ||
@@ -30,0 +30,0 @@ |
@@ -66,5 +66,5 @@ 'use strict'; | ||
function run(app, drivers) { | ||
if (typeof app !== 'function') { | ||
throw new Error('First argument given to Cycle.run() must be the `app` ' + 'function.'); | ||
function run(main, drivers) { | ||
if (typeof main !== 'function') { | ||
throw new Error('First argument given to Cycle.run() must be the `main` ' + 'function.'); | ||
} | ||
@@ -81,3 +81,3 @@ if (typeof drivers !== 'object' || drivers === null) { | ||
var responses = makeAppInput(requestProxies, rawResponses); | ||
var requests = app(responses); | ||
var requests = main(responses); | ||
setTimeout(function () { | ||
@@ -91,7 +91,7 @@ return replicateMany(requests, requestProxies); | ||
/** | ||
* Takes an `app` function and circularly connects it to the given collection | ||
* Takes an `main` function and circularly connects it to the given collection | ||
* of driver functions. | ||
* | ||
* The `app` function expects a collection of "driver response" Observables as | ||
* input, and should return a collection of "driver request" Observables. | ||
* The `main` function expects a collection of "driver response" Observables | ||
* as input, and should return a collection of "driver request" Observables. | ||
* A "collection of Observables" is a JavaScript object where | ||
@@ -101,3 +101,3 @@ * keys match the driver names registered by the `drivers` object, and values | ||
* | ||
* @param {Function} app a function that takes `responses` as input | ||
* @param {Function} main a function that takes `responses` as input | ||
* and outputs a collection of `requests` Observables. | ||
@@ -107,3 +107,3 @@ * @param {Object} drivers an object where keys are driver names and values | ||
* @return {Array} an array where the first object is the collection of driver | ||
* requests, and the second objet is the collection of driver responses, that | ||
* requests, and the second object is the collection of driver responses, that | ||
* can be used for debugging or testing. | ||
@@ -110,0 +110,0 @@ * @function run |
{ | ||
"name": "@cycle/core", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Andre Staltz", | ||
"description": "A fully reactive JavaScript framework for Human-Computer Interactio", | ||
"description": "A fully reactive JavaScript framework for Human-Computer Interaction", | ||
"license": "MIT", | ||
@@ -7,0 +7,0 @@ "homepage": "https://cyclejs.github.io", |
@@ -17,3 +17,3 @@ <h1> | ||
- Understand how Cycle.js works in general: go to http://cyclejs.github.io | ||
- Understand how Cycle.js works in general: go to http://cycle.js.org | ||
- Understand how Cycle *Core* itself works: read the [docs](https://github.com/cyclejs/cycle-core/blob/master/docs/api.md) and the [tests](https://github.com/cyclejs/cycle-core/tree/master/test) | ||
@@ -33,1 +33,2 @@ - Contribute a new driver: [open an issue](https://github.com/cyclejs/cycle-core/issues/new) | ||
[![devDependency Status](https://david-dm.org/cyclejs/cycle-core/dev-status.svg)](https://david-dm.org/cyclejs/cycle-core#info=devDependencies) | ||
[![JS.ORG](https://img.shields.io/badge/js.org-cycle-ffb400.svg?style=flat-square)](http://js.org) |
@@ -60,5 +60,5 @@ 'use strict'; | ||
function run(app, drivers) { | ||
if (typeof app !== 'function') { | ||
throw new Error('First argument given to Cycle.run() must be the `app` ' + | ||
function run(main, drivers) { | ||
if (typeof main !== 'function') { | ||
throw new Error('First argument given to Cycle.run() must be the `main` ' + | ||
'function.'); | ||
@@ -78,3 +78,3 @@ } | ||
let responses = makeAppInput(requestProxies, rawResponses); | ||
let requests = app(responses); | ||
let requests = main(responses); | ||
setTimeout(() => replicateMany(requests, requestProxies), 1); | ||
@@ -86,7 +86,7 @@ return [requests, responses]; | ||
/** | ||
* Takes an `app` function and circularly connects it to the given collection | ||
* Takes an `main` function and circularly connects it to the given collection | ||
* of driver functions. | ||
* | ||
* The `app` function expects a collection of "driver response" Observables as | ||
* input, and should return a collection of "driver request" Observables. | ||
* The `main` function expects a collection of "driver response" Observables | ||
* as input, and should return a collection of "driver request" Observables. | ||
* A "collection of Observables" is a JavaScript object where | ||
@@ -96,3 +96,3 @@ * keys match the driver names registered by the `drivers` object, and values | ||
* | ||
* @param {Function} app a function that takes `responses` as input | ||
* @param {Function} main a function that takes `responses` as input | ||
* and outputs a collection of `requests` Observables. | ||
@@ -102,3 +102,3 @@ * @param {Object} drivers an object where keys are driver names and values | ||
* @return {Array} an array where the first object is the collection of driver | ||
* requests, and the second objet is the collection of driver responses, that | ||
* requests, and the second object is the collection of driver responses, that | ||
* can be used for debugging or testing. | ||
@@ -105,0 +105,0 @@ * @function run |
@@ -21,3 +21,3 @@ 'use strict'; | ||
Cycle.run('not a function'); | ||
}, /First argument given to Cycle\.run\(\) must be the `app` function/i); | ||
}, /First argument given to Cycle\.run\(\) must be the `main` function/i); | ||
}); | ||
@@ -24,0 +24,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
618502
33