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

Move deferred properties to same animation frame #812

@tomdye

Description

@tomdye

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 ]);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions