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 { | |
useReducerWithEffects, | |
emitEffect, | |
} from 'react'; | |
// In a component | |
const UserComponent = () => { | |
function fetchUserEffect(id, parentRef) { | |
const controller = new AbortController(); | |
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
<!doctype html> | |
<html> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-sham.js"></script> | |
<script src="http://fb.me/react-0.8.0.min.js"></script> | |
<script src="http://fb.me/JSXTransformer-0.8.0.js"></script> | |
<script type="text/jsx"> | |
/** @jsx React.DOM */ | |
var InputBox = React.createClass({ |
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
/* This class is used to create the /topic/projectfeedback page, | |
* which shows expandable lists of feedback requests that need answering. | |
*/ | |
var ProjectFeedbackPage = React.createClass({ | |
propTypes: { | |
topic: React.PropTypes.string.isRequired | |
}, | |
render: function() { | |
var helpCollection = new DiscussionItemCollection([], { | |
topic: this.props.topic, |
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
require "rack" | |
app = lambda do |env| | |
request = Rack::Request.new(env) | |
if request.get? | |
[ | |
200, | |
{"Content-Type" => "text/html"}, | |
<<-HTML |