Create secondary dependency in find


#1

I have a desire to depend on a second dependency related to the results of a find query from mongodb. Specifically, I have a paired object which has some reactive information that may be updated separately and would like to create a dependency on that as well as a result of the find.

One idea I had was a transform pass through:

findWithDependency(query = {}) {
  return MyCollection.find(query, 
    {
      transform: record => {
        myDependency.depend(); 
        return record;
      }
    }
  );
}

Needless to say that doesn’t work because:

Does anyone have any good ideas on how to enable this secondary dependency?