useEffect hook with injected current flag
React is now a peer and dev dependency, there is therefore no regular dependencies
Changed the injected parameter to be a function that returns the current state of the effect. This should clean up the API a little and allow for naming the function whatever the user wishes.