Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Move deferred properties to same animation frame #812

Open
tomdye opened this issue Dec 27, 2017 · 0 comments
Open

Move deferred properties to same animation frame #812

tomdye opened this issue Dec 27, 2017 · 0 comments

Comments

@tomdye
Copy link
Member

tomdye commented Dec 27, 2017

Enhancement
Currently, the deferred properties function call is made on the next animation frame unless the projector is set to sync and there is no indication of wether if the function has been called on before or after the dom has been updated.

Moving deferred properties to same animation frame in all cases and adding a flag to denote if it's the first or second call will make it easier / possible to perform the class based domnode calculations required for more complicated ui transitions / animations.

For example:

protected render() {
	let width = '';
	return v('div', (inserted, deferred) => {
		const expandedAndUpdated = deferred && this._expanded;
		if (expandedAndUpdated) {
                        // previously we would not have been able to do this in the same AF
			const dimensions = this.meta(Dimensions).get('root');
			width = dimensions.size.width;
		}

		return {
			key: 'root',
			classes: [
				this._expanded ? css.expanded : null
			]
		};
	}, [ width ]);
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants