Skip to content

Commit

Permalink
appease typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Aug 4, 2019
1 parent 4a2bb52 commit 60467f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/internal/transitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function create_in_transition(node: Element & ElementCSSInlineStyle, fn:
easing = linear,
tick = noop,
css
} = config || null_transition;
} = config || (null_transition as TransitionConfig);

if (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
tick(0, 1);
Expand Down Expand Up @@ -166,7 +166,7 @@ export function create_out_transition(node: Element & ElementCSSInlineStyle, fn:
easing = linear,
tick = noop,
css
} = config || null_transition;
} = config || (null_transition as TransitionConfig);

if (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);

Expand Down Expand Up @@ -260,7 +260,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
easing = linear,
tick = noop,
css
} = config || null_transition;
} = config || (null_transition as TransitionConfig);

const program = {
start: now() + delay,
Expand Down

1 comment on commit 60467f6

@Conduitry
Copy link
Member

@Conduitry Conduitry commented on 60467f6 Aug 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just put as TransitionConfig once where you define null_transition instead of each place that you use it?

edit: const null_transition: TransitionConfig = ..., actually. And yes, it looks like TS is happy with that.

edit again: Pushed that change.

Please sign in to comment.