Skip to content

Commit

Permalink
[fixed] type on transformOrigin in combineStyleStreams internals
Browse files Browse the repository at this point in the history
Summary: There's a bunch more work to be done on the types here (#250), but this gets us building cleanly.

Reviewers: O2 Material Motion, O3 Material JavaScript platform reviewers, #material_motion

Tags: #material_motion

Differential Revision: http://codereview.cc/D3469
  • Loading branch information
appsforartists committed Nov 27, 2018
1 parent 09d1ac6 commit 5946a4f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/views-dom/src/combineStyleStreams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ export type PrimitiveStyleDict = Partial<{
scale: number,
transformOrigin: Partial<Point2D>,
dimensions: Partial<Dimensions>,
}> & CSS.Properties;

// Explicitly pass through the styles that `combineStyleStreams` needs.
//
// Can't `& CSS.Properties` because that causes conflicts for the shape of
// `transformOrigin`. See #250.
borderRadius: CSS.Properties['borderRadius'],
willChange: CSS.Properties['willChange'],
width: CSS.Properties['width'],
height: CSS.Properties['height'],
}>;

// TODO(#250): Merge StyleStreams and csstype
export function combineStyleStreams(styleStreams: Partial<StyleStreams>): ObservableWithMotionOperators<CSS.Properties> {
return combineLatest<PrimitiveStyleDict, MaybeReactive<PrimitiveStyleDict>>(
stripStreamSuffices(styleStreams as StyleStreams) as MaybeReactive<PrimitiveStyleDict>,
Expand Down

0 comments on commit 5946a4f

Please sign in to comment.