bootprint / customize

This repository has moved to https://github.com/bootprint/bootprint-monorepo/tree/master/packages/customize
MIT License
1 stars 2 forks source link

`this.parent()` should consistently return a promise, at least optionally #7

Open nknapp opened 7 years ago

nknapp commented 7 years ago

The .withParent() wraps a function such that the overridden function is available under this.parent(input).

Dependending on the context and the implementation this.parent(input) may return a Promise or not. This makes it hard to implement the overriding function, because the implementor does not always no the exact function that is overridden (this may depend on the loading order of plugins in Thought for example.

Since customize is otherwise promise agnostic, this.parent(input) should always return the same kind of data, which is a promise, even if the parent preprocessor actually returns immediate data.