Skip to content

Instantly share code, notes, and snippets.

View wcjohnson's full-sized avatar

William C. Johnson wcjohnson

  • Open Informatics Group, LLC
View GitHub Profile
@wcjohnson
wcjohnson / observeSelector.coffee
Created March 11, 2016 17:44
observeSelector pattern
#
# Observable pattern for Redux selectors.
# Compares using _ deep equality.
# See: https://github.com/rackt/redux/issues/303#issuecomment-125184409
#
_ = require 'underscore'
deepEqualityTest = _.isEqual
objectEqualityTest = (a,b) -> a is b
Source code:
let o
now o = {
f() =>
this
}
Transformed code:
> node util/test-source-maps.js "test/fixtures/arrow-methods-obj/fat-assign/actual.js"
test/fixtures/arrow-methods-obj/fat-assign/actual.js
Source code:
let o
now o = {
f() =>
this