DEV Community

Discussion on: Discover and extract dependencies

Collapse
 
mtbsickrider profile image
Enrique Jose Padilla • Edited

Wouldn't this function need to be called everytime with dependencies?

I'm curius as to not why:

const loadStudent = (dependencies = defaultDependencies()) => ({ studentId }) => {
  // ...
};

So the function can now hold state for the initial dependencies given.

Collapse
 
wolframkriesing profile image
Home Officer

yep works too. fine with me.