Skip to content

Instantly share code, notes, and snippets.

View cmeeren's full-sized avatar

Christer van der Meeren cmeeren

View GitHub Profile
@cmeeren
cmeeren / App.fs
Last active September 18, 2019 09:07
Movable, hierarchical boxes with MVU architecture using Elmish (triggered by this comment thread: http://bit.ly/2O9eAnu)
module Elmish.Boxes
open System
open Fable.React.Helpers
open Fable.React.Props
open Fable.React.Standard
[<AutoOpen>]
module Domain =
@cmeeren
cmeeren / App.xaml
Last active February 12, 2018 08:29
Android flat button support in Xamarin.Forms
<Application
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:MyApp.Controls;assembly=MyApp"
x:Class="MyApp.App">
<Application.Resources>
<ResourceDictionary>
<!-- Implicit style - BackgroundColor works on iOS, but not Android (https://bugzilla.xamarin.com/show_bug.cgi?id=60392),
hence the need for the custom renderer in the first place. -->
@cmeeren
cmeeren / ProjectingStore.cs
Last active April 2, 2017 11:16
Implementation of Redux.NET store that only surfaces the state through projections
namespace Redux
{
using System;
using System.Reactive.Linq;
using JetBrains.Annotations;
/// <summary>A wrapper for <see cref="C:Store{TState}" /> whose state is only accessible through projections.</summary>
public class ProjectingStore<TState>
{
private readonly Store<TState> store;
@cmeeren
cmeeren / EventTest.cs
Created April 2, 2017 09:49
Tests that all handlers are called last with the latest state (fails)
namespace NestedEventTest
{
using System;
using NUnit.Framework;
public class EventSource
{
private int i;
@cmeeren
cmeeren / EventTest.cs
Created April 2, 2017 09:12
Test that shows that all handlers are invoked before unsubscribing
namespace EventUnsubscriptionTest
{
using System;
using NUnit.Framework;
public class EventSource
{
public event Action Event;