Skip to content

Commit

Permalink
Merge pull request facebook#49 from reasonml-community/styles
Browse files Browse the repository at this point in the history
Add Style.flatten
  • Loading branch information
wokalski authored Jul 31, 2017
2 parents 5f0c4aa + 1c65ce4 commit 371989f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/styleRe.re
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
type t;

external flatten : array t => t = "%identity";

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

external style_to_dict : t => Js.Dict.t Js.Json.t = "%identity";
Expand Down
11 changes: 9 additions & 2 deletions src/styleRe.rei
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
type t;

/** Generates a style out of an array of styles.
* This is equivalent:
* // js
* <View style={[styleA, styleB]} />
* // reason
* <View style=(Style.flatten [|styleA, styleB|]) />
*/
let flatten: array t => t;

type style;

let style: list style => t;
Expand All @@ -9,8 +18,6 @@ let combine: t => t => t;
let concat: list t => t;


/** Equivalent to [style_a, style_b] in js */

/**
* Layout Props
*/
Expand Down

0 comments on commit 371989f

Please sign in to comment.