Skip to content

Instantly share code, notes, and snippets.

Avatar

James Nail jrnail23

View GitHub Profile
@jrnail23
jrnail23 / diff.js
Created Jul 6, 2017
objectDiff in Ramda
View diff.js
// https://github.com/ramda/ramda/wiki/Cookbook#diffobjs---diffing-objects-similar-to-guavas-mapsdifference
const groupObjBy = R.curry(R.pipe(
// Call groupBy with the object as pairs, passing only the value to the key function
R.useWith(R.groupBy, [R.useWith(R.__, [R.last]), R.toPairs]),
R.map(R.fromPairs)
))
const objectDiff = R.pipe(
R.useWith(R.mergeWith(R.merge), [R.map(R.objOf('leftValue')), R.map(R.objOf('rightValue'))]),
groupObjBy(R.cond([
@jrnail23
jrnail23 / AutofacShortBusExploratoryTests
Last active Jan 1, 2016
Exploratory tests to demonstrate differences in ShortBus.Autofac before and after pull-request 17 (https://github.com/mhinze/ShortBus/pull/17).
View AutofacShortBusExploratoryTests
using System;
using Autofac;
using NUnit.Framework;
using ShortBus.Autofac;
namespace ShortBus.Tests.Example
{
[TestFixture]
public class AutofacExploratoryTests
{
You can’t perform that action at this time.