injects components into the function at last arg