(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
The MIT License (MIT) | |
Copyright (c) 2016 Stuart Powers | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/indented-tree |
/** | |
* Module dependencies | |
*/ | |
var express = require('express'); | |
var fs = require('fs'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
// img path |
/** | |
* Parse a constructor's signature to find out the names of his arguments. This | |
* is central to AngularJS dependency injection mechanism. | |
*/ | |
function annotate(fn) { | |
var $inject, fnText, argDecl, last; | |
if (typeof fn == 'function') { | |
if (!($inject = fn.$inject)) { | |
$inject = []; |
Highcharts.Chart.prototype.callbacks.push(function(chart) { | |
var hasTouch = document.documentElement.ontouchstart !== undefined, | |
mouseTracker = chart.pointer, | |
container = chart.container, | |
mouseMove; | |
mouseMove = function (e) { | |
// let the system handle multitouch operations like two finger scroll | |
// and pinching |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import UIKit | |
public class FColor{ | |
public var a:CGFloat = 1.0; | |
public var r:CGFloat = 1.0; | |
public var g:CGFloat = 1.0; | |
public var b:CGFloat = 1.0; | |
init(r:CGFloat = 1.0, g:CGFloat = 1.0, b:CGFloat = 1.0, a:CGFloat = 1.0){ | |
self.r = r; |
If you've reached this page, it's probably because your "parent-based and owner-based contexts differ".
As we've been iterating on React's "context" feature, we've discovered that the parent-based relationship is more useful than the owner-based relationship, so we're migrating to use a parent-based hierarchy.
In short, the owner of a component is whomever creates the component, while the parent of a component is whomever would be the containing ancestor in the DOM hierarchy. To learn more about the owner relationship, see the docs here: http://facebook.github.io/react/docs/multiple-components.html
In many cases, the owner and the parent are the same node, in which case, no further action is necessary.
import React from 'react'; | |
let lastScrollY = 0; | |
let ticking = false; | |
class App extends React.Component { | |
componentDidMount() { | |
window.addEventListener('scroll', this.handleScroll, true); | |
} |