This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal! If you're on your phone, please request the 🖥 desktop site to star this gist 😇 #ReactiveConf
This file contains 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
import { h, ChildNode, FunctionalComponent, FunctionalUtilities } from "@stencil/core"; | |
function vnodeToSource(elem: ChildNode, utils: FunctionalUtilities, output = "", level = 0): string { | |
if (elem.vchildren) { | |
let childOutput: string[] = []; | |
utils.forEach(elem.vchildren, (child) => { | |
childOutput.push(vnodeToSource(child, utils, output, level + 1)); | |
}); |
This file contains 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
<animatable-component | |
autoplay | |
easing="ease-in-out" | |
duration="800" | |
delay="300" | |
animation="zoomIn" | |
iterations="Infinity" | |
direction="alternate" | |
> | |
<h1>Hello World</h1> |
The React community is moving away from HOC (higher order components) in favor of render prop components (RPC). For the most part, HOC and render prop components solve the same problem. However, render prop components provide are gaining popularity because they are more declarative and flexible than an HOC.
Read more:
This file contains 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
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import configureStore from "./store/configureStore"; | |
const store = configureStore(); | |
const rootEl = document.getElementById("root"); |
This file contains 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
import mySaga from 'mySaga'; | |
import { take, fork, cancel } from 'redux-saga/effects'; | |
const sagas = [mySaga]; | |
export const CANCEL_SAGAS_HMR = 'CANCEL_SAGAS_HMR'; | |
function createAbortableSaga (saga) { | |
if (process.env.NODE_ENV === 'development') { | |
return function* main () { |
This file contains 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
class MAP_API_DemoItemType extends WP_JSON_CustomPostType { | |
protected $base = '/map/demo'; | |
protected $type = 'demo'; | |
public function register_routes( $routes ) { | |
$routes = parent::register_routes( $routes ); | |
return $routes; | |
} | |
} |
This file contains 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'; | |
/** | |
* Equal Heights | |
* | |
* Attach this directive to the parent/wrapping element of | |
* a bunch of elements that are columns. This directive will | |
* calculate the height of every direct child (one level down) | |
* then set all of them to be the height of the tallest one. | |
* |
This file contains 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
loadImageLocation: function loadImageLocation(imageLocation) { | |
var preloader = this; | |
var _onLoadHandler = function(event) { | |
// Since the load event is asynchronous, we have to | |
// tell AngularJS that something changed. | |
$rootScope.$apply( |
This file contains 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
app.filter('trusthtml', ['$sce', function ($sce) { | |
return function(t) { | |
return $sce.trustAsHtml(t) | |
} | |
}]); |
NewerOlder