Skip to content

Commit 6ddd60d

Browse files
authored
Add ToClassList instance :: Array String (#88)
1 parent aef5106 commit 6ddd60d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Flame/Html/Attribute/Internal.purs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Foreign.Object (Object)
1515
import Foreign.Object as FO
1616
import Partial as P
1717
import Partial.Unsafe as PU
18-
import Prelude (const, flip, map, not, otherwise, show, ($), (<<<), (<>), (==))
18+
import Prelude (const, flip, identity, map, not, otherwise, show, ($), (<<<), (<>), (==))
1919
import Type.Row.Homogeneous (class Homogeneous)
2020

2121
type ToStringAttribute = ToNodeData String
@@ -33,6 +33,9 @@ class ToClassList a where
3333
instance ToClassList String where
3434
to = DA.filter (not <<< DS.null) <<< DS.split (Pattern " ")
3535

36+
instance ToClassList (Array String) where
37+
to = identity
38+
3639
instance Homogeneous r Boolean ToClassList { | r } where
3740
to = FO.keys <<< FO.filterWithKey (flip const) <<< FO.fromHomogeneous
3841

0 commit comments

Comments
 (0)