Merge branch 'hyperfiddle-#385'

This commit is contained in:
Juho Teperi 2018-12-31 12:56:21 +02:00
commit b16210eeaa
3 changed files with 11 additions and 1 deletions

View File

@ -10,6 +10,7 @@
ensure `:class` is merged correctly when it is defined as collection. ([#412](https://github.com/reagent-project/reagent/issues/412))
- Add `reagent.core/class-names` utility functions which can be used
to normalize and combine `:class` values (similar to `classnames` JS library)
- Fix comparing Reagent `PartialFn` to `nil` ([#385](https://github.com/reagent-project/reagent/issues/385))
## 0.8.1 (2018-05-15)

View File

@ -100,7 +100,9 @@
(apply pfn a b c d e f g h i j k l m n o p q r s t rest))
IEquiv
(-equiv [_ other]
(and (= f (.-f other)) (= args (.-args other))))
(and (instance? PartialFn other)
(= f (.-f other))
(= args (.-args other))))
IHash
(-hash [_] (hash [f args])))

View File

@ -69,3 +69,10 @@
{:class ["baz" "quux"]})
(util/merge-props nil {:class ["foo" "bar" "baz" "quux"]})
(util/merge-props {:class ["foo" "bar" "baz" "quux"]})))))
(deftest partial-fn-test
(is (= (util/make-partial-fn println ["a"])
(util/make-partial-fn println ["a"])))
(is (not (= (util/make-partial-fn println ["a"])
nil))))