Open josephjclark opened 3 months ago
Quick brainstorm of options:
import * as util from './utils'
into each job. Now the exports from each job are available on a utils object. So you can do utils.convertToLocalCurrency
. I quite like this: it's achievable at low cost and adds a lot of utility. We need the right word for utils. Maybe the workflow can map it to whatever variable you like.
It's fairly common in implementation to have to use the same helper function in multiple jobs. Water-aid, for example, defines a very complex function called
convertToLocalCurrency
which is duplicated in two jobs.We need to be able to declare a function somewhere, and re-use it across multiple jobs. This probably plays into the unit-testing story too.
The difficulty of course is that if you write a function to state, it'll be destroyed at the end of the job when the state is serialised