Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

252
Vistas
Reselect error: createSelector expects all input-selectors to be functions, but received the following types: [undefined, function memoized()]

I have tests that keep failing and throwing the following error:

createSelector expects all input-selectors to be functions, but received the following types: [undefined, function memoized()]

I have realised it is because of this function that the error is being thrown:

export const rejectedConsignmentEventsToMapOfConsignmentIdsToEventMap = createImmutableEqualSelector(
      eventsSelector,
      (events) =>
        events
          .filter((ce) => ce.get('type') === EventType.REJECTED)
          .valueSeq()
          .groupBy((it) => it.get('packageId'))
    )

I am not sure why is this causing an issue, when the following function that looks pretty much the same is not:

export const eventsToMapOfPackageIdsToEventMap = createImmutableEqualSelector(
  eventsSelector,
  (events) => events.valueSeq().groupBy((it) => it.get('packageId'))
)

When I am running my app, everything works fine and as expected, no errors are thrown, only when I am running tests I get this error. What am I doing wrong here with the first function, why it is causing this error?

8 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos