Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass 'intro/outro' parameter to transition generators? #4015

Closed
mrkishi opened this issue Nov 29, 2019 · 2 comments
Closed

Pass 'intro/outro' parameter to transition generators? #4015

mrkishi opened this issue Nov 29, 2019 · 2 comments

Comments

@mrkishi
Copy link
Member

mrkishi commented Nov 29, 2019

Currently, we can't find out if we are introing or outroing from a "transition generator" (that's what I'm calling the functions that are returned from transition functions -- the ones that are called just before a transition starts to get a TransitionConfig object).

While we can use separate in: and out: directives (like for crossfade), for a number of use cases that's unneeded boilerplate.

I propose that we start passing an intro: boolean to them:

export function my_transition(node: Element, params: any) {
    return function (intro: boolean) {
        return intro ? wacky_intro_params(params) : coordinated_outro(params);
    };
}

This wouldn't be a breaking change, but it would expand on the contract we have to support in the future. Personally, I think it's worth it, being such a small change, but what are our thoughts on it?

I tried coming up with hacky ways to figure out if it's an intro but came up with nothing that worked reliably.

@Conduitry
Copy link
Member

Is this the same as #3918?

@mrkishi
Copy link
Member Author

mrkishi commented Nov 29, 2019

Ugh, I don't know how I missed that one.

It's not quite the same, but indeed very similar--I'll post there instead.

@mrkishi mrkishi closed this as completed Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants