- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git$ nano ~/.zshrc- Add
path=('/path/to/depot_tools' $path)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // "use strict"; | |
| var LibraryTst = { | |
| initialize: function (callback) { | |
| callback = Runtime.getFuncWrapper(callback, 'vi') | |
| var numBytes = 2 * Float32Array.BYTES_PER_ELEMENT | |
| var ptr = Module._malloc(numBytes) | |
| try { | |
| callback(ptr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var React = require('react'); | |
| function createAsyncHandler(getHandlerAsync, displayName) { | |
| var Handler = null; | |
| return React.createClass({ | |
| displayName: displayName, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var allDone = function(done){ // takes a callback that will be called as callback(errors, values) when all async parallel operations are finished. | |
| var context = {task: {}, data: {}}; | |
| context.end = function(e,v){ return done(e,v), done = function(){} }; // this can always be called if you want to terminate early, like because an error. | |
| context.add = function(fn, id){ // if the async operation you are doing replies with standard fn(err, value) then just pass in a string ID, else your own callback and ID. | |
| context.task[id = (typeof fn == 'string')? fn : id] = false; | |
| var next = function(err, val){ | |
| context.task[id] = true; // good, we're done with this one! | |
| if(err){ (context.err = context.err || {})[id] = err } // record errors. | |
| context.data[id] = val; // record the values. | |
| for(var i in c.task){ if(c.task.hasOwnProperty(i)){ // loop over the async task checker |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const I = x => x | |
| const K = x => y => x | |
| const A = f => x => f (x) | |
| const T = x => f => f (x) | |
| const W = f => x => f (x) (x) | |
| const C = f => y => x => f (x) (y) | |
| const B = f => g => x => f (g (x)) | |
| const S = f => g => x => f (x) (g (x)) | |
| const S_ = f => g => x => f (g (x)) (x) | |
| const S2 = f => g => h => x => f (g (x)) (h (x)) |
OlderNewer