See the Pen value-provider-with-logic by soritesparadox (@soritesparadox) on CodePen.