(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.
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Analog Clock</title> | |
<script> | |
function updateTime() { // Update the SVG clock | |
var now = new Date(); | |
var sec = now.getSeconds(); | |
var min = now.getMinutes(); | |
var hour = (now.getHours() % 12) + min/60; |
javascript: (function () { | |
new_window = window.open(); | |
new_window.document.body.innerHTML = $("iframe") | |
.contents() | |
.find("iframe") | |
.contents() | |
.find("body") | |
.get(1).innerHTML; | |
new_window.document.body.querySelector("#content-overlays").remove(); | |
})(); |
public class GetEventStoreEventDispatcher | |
{ | |
private const int RECONNECT_TIMEOUT_MILLISEC = 5000; | |
private const int THREAD_KILL_TIMEOUT_MILLISEC = 5000; | |
private const int READ_PAGE_SIZE = 500; | |
private const int LIVE_QUEUE_SIZE_LIMIT = 10000; | |
private readonly IEventBus _eventBus; | |
private readonly EventStoreConnection _store; |
public static void ConfigureForTesting(this ApiController controller, HttpRequestMessage request, string routeName = null, HttpRoute route = null) | |
{ | |
var config = new HttpConfiguration(); | |
controller.Configuration = config; | |
if (routeName != null && route !=null) | |
config.Routes.Add(routeName, route); | |
else | |
route = config.Routes.MapHttpRoute("DefaultApi", "{controller}/{id}", new { id = RouteParameter.Optional }); | |
var controllerTypeName = controller.GetType().Name; |
//Special thanks to Andrii Nakryiko and James Nugent | |
//for their help with this code. | |
namespace Infrastructure.EventStorage | |
{ | |
using System; | |
using System.Collections.Concurrent; | |
using System.Net; | |
using System.Text; | |
using System.Threading; | |
using EventStore.ClientAPI; |
(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.
public class AggregateReader | |
{ | |
private readonly Func<IAggregateRootEntity> _rootFactory; | |
private readonly IEventStoreConnection _connection; | |
private readonly EventStoreReaderConfiguration _configuration; | |
public AggregateReader( | |
Func<IAggregateRootEntity> rootFactory, | |
IEventStoreConnection connection, | |
EventStoreReaderConfiguration configuration) |
These instructions are basic and a work in progress. They will be improving a lot over time.
Once you've followed the steps in this document, use the following sample to see the changes you need to make to your project: https://github.com/dotnet/corefxlab/tree/master/samples/ClassLib.
import hoistStatics from 'hoist-non-react-statics'; | |
import React from 'react'; | |
/** | |
* Allows two animation frames to complete to allow other components to update | |
* and re-render before mounting and rendering an expensive `WrappedComponent`. | |
*/ | |
export default function deferComponentRender(WrappedComponent) { | |
class DeferredRenderWrapper extends React.Component { | |
constructor(props, context) { |
import React from "react"; | |
import { Link } from "react-router-dom"; | |
export function createResource(getPromise) { | |
let cache = {}; | |
let inflight = {}; | |
let errors = {}; | |
function load(key) { | |
inflight[key] = getPromise(key) |