Skip to content

Commit 371989f

Browse files
authored
Merge pull request facebook#49 from reasonml-community/styles
Add Style.flatten
2 parents 5f0c4aa + 1c65ce4 commit 371989f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/styleRe.re

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
type t;
22

3+
external flatten : array t => t = "%identity";
4+
35
external to_style : Js.Dict.t Js.Json.t => t = "%identity";
46

57
external style_to_dict : t => Js.Dict.t Js.Json.t = "%identity";

src/styleRe.rei

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
type t;
22

3+
/** Generates a style out of an array of styles.
4+
* This is equivalent:
5+
* // js
6+
* <View style={[styleA, styleB]} />
7+
* // reason
8+
* <View style=(Style.flatten [|styleA, styleB|]) />
9+
*/
10+
let flatten: array t => t;
11+
312
type style;
413

514
let style: list style => t;
@@ -9,8 +18,6 @@ let combine: t => t => t;
918
let concat: list t => t;
1019

1120

12-
/** Equivalent to [style_a, style_b] in js */
13-
1421
/**
1522
* Layout Props
1623
*/

0 commit comments

Comments
 (0)