You probably came here because your code is calling your component as a plain function call. This is now deprecated:
var MyComponent = require('MyComponent');
function render() {
return MyComponent({ foo: 'bar' }); // WARNING| # 內容 | |
| # repo 位置 | |
| - https://github.com/facebook/react | |
| - https://github.com/facebook/flux | |
| # 官網 | |
| - React | |
| * http://facebook.github.io/react/ |
| # var xs = [1,2,3] | |
| # doubleMe(doubleMe(doubleMe(xs))) | |
| #這樣寫法有很多缺點,太多層次要把全部層次讀完才能知道最後結果。 | |
| #在墮性語言之中 | |
| #我們要做到調用 doubleMe 時並不會立即求值,它會說“嗯嗯,待會兒再做!” | |
| #在真正執行時只會是一個平面,像 xs *2 *2 *2; | |
| (a, b, c) --> a * b * c | |
| #代替了 |
| # extent 擴充(繼承) | |
| # 在js之中 沒有class概念,但是是拿建構式來實現class | |
| class Animal | |
| (@name, kind) -> | |
| @kind = kind | |
| action: (what) -> "*#{@name} (a #{@kind}) #{what}*" | |
| class Cat extends Animal | |
| (@name) -> super @name, 'cat' | |
| purr: -> @action 'purrs' |
| uploader = $fileUploader.create( | |
| scope: $scope | |
| url: "http://#{$rootScope.api}/proposal/upload" | |
| formData: [{ | |
| key: \value | |
| }] | |
| filters: [ | |
| (item) -> | |
| if item.size >10000000 | |
| alert \size不得超過10mb |
| /** | |
| * A generic confirmation for risky actions. | |
| * Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function | |
| */ | |
| angular.module('app').directive('ngReallyClick', [function() { | |
| return { | |
| restrict: 'A', | |
| link: function(scope, element, attrs) { | |
| element.bind('click', function() { | |
| var message = attrs.ngReallyMessage; |
| // easing functions http://goo.gl/5HLl8 | |
| Math.easeInOutQuad = function (t, b, c, d) { | |
| t /= d/2; | |
| if (t < 1) { | |
| return c/2*t*t + b | |
| } | |
| t--; | |
| return -c/2 * (t*(t-2) - 1) + b; | |
| }; |
| #特殊的require 可以輕鬆使用參數 | |
| ### read argument | |
| require 'optparse' | |
| $options = {} | |
| OptionParser.new do |opts| | |
| opts.on("-r") { |s| $options[:r] = true } | |
| opts.on("-i", '-i INPUT', "input ") { |s| $options[:i] = s } # ./queries/origin/query-5.xml | |
| opts.on("-o", '-o OUTPUT',"output") { |s| $options[:o] = s } # ans | |
| opts.on("-m", '-m MODEL', "model ") { |s| $options[:m] = s } # ./model-files |
Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist.
Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).