Skip to content

Collection.gather requires identical names for values of type Item and Stream<Item> #32

Description

@bbarker

While using something like Collection.gather(Task, sources, fetchedTasks$, 'uid') , I have to make sure fetchedTasks$ has objects where the property item is actually named item$. No idea why. This requires me to use a transformer like this:

function crazyHack(subCols: Stream<SubForCollection[]>): Stream<any> {
  return subCols.map( scs => scs.map(sc => {
    return {
      // For some reason, Collection wants submission to
      // be named submission$
      submission$: sc.submission,
      submission_id: sc.submission_id
    };
  }))

I then call e.g., Collection.gather(Task, sources, crazyHack(fetchedTasks$), 'uid').

This happened during an automatic refactor of naming submission to the more appropriate submission$ and took me hours to find, so I would advocate removing this dependence if possible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions