An FRP application has the following properties
- Functional, pure, immutable.
- Reactive, your application is a DAG, you react to "core" inputs and from new outputs.
If your application is an immutable DAG it has certain properties
| var createElement = require('virtual-dom/create-element.js'); | |
| var diff = require('virtual-dom/diff'); | |
| var patch = require('virtual-dom/patch'); | |
| var document = require('global/document'); | |
| /* | |
| A PureWrapperWidget wraps a vnode in a container. | |
| It can do all kinds of DOM specific logic on the | |
| container if you wanted to. Like handling |
| var timeoutStacks = (function () { | |
| var $timers = require('timers'); | |
| var $setInterval = $timers.setInterval; | |
| var $setTimeout = $timers.setTimeout; | |
| var stacks = {}; | |
| global.setInterval = function (fn, timeout) { | |
| var stack = new Error().stack; |
This is a list of links I have read:
Warning: good quality :)
| module.exports = clickEvent; | |
| function clickEvent(handler, opts) { | |
| opts = opts || {}; | |
| return function clickHandler(ev) { | |
| if (!opts.ctrl && ev.ctrlKey) { | |
| return; | |
| } |
| var STATUS_CODES = require('http').STATUS_CODES; | |
| var sendJson = require('send-data/json'); | |
| var url = require('url'); | |
| function (req, res, opts) { | |
| var clients = opts.clients; | |
| var config = opts.config; | |
| var errOpts = { | |
| // verbose is true in dev where it prints stacks |
| // lib/create-server.js | |
| var http = require('http'); | |
| var perf = require('playdoh-server/perf'); | |
| module.exports = createServer; | |
| function createServer(handler, opts) { | |
| // boot your app here | |
| var server = http.createServer(handler); | |
| var config = opts.config; |
| var diff = require('virtual-dom/diff'); | |
| var patch = require('virtual-dom/patch'); | |
| var h = require('virtual-dom/h'); | |
| var createElement = require('virtual-dom/create-element'); | |
| var virtualize = require('vdom-virtualize'); | |
| // 1: Create a function that declares what the DOM should look like | |
| function render(count) { | |
| // var html = '<div id="test">Count is <span>' + count + '</span></div>'; | |
| //return virtualize.fromHTML(html); |
| { | |
| "validateIndentation": 4, | |
| "maximumLineLength": { | |
| "value": 80, | |
| "allowUrlComments": true, | |
| "allowComments": false, | |
| "allowRegex": false | |
| }, | |
| "requireSpaceAfterKeywords": [ | |
| "if", |
| var jsonBody = require('body/json'); | |
| /* usage | |
| ```js | |
| router.addRoute('/foo/bar', | |
| bodyParser(function (req, res, opts, cb))) | |
| ``` | |
| using multiple "middlewares" |