Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
¿Cómo simplificar la referencia de tuberías anidadas/arg en javascript fp?

Tengo que exponer el argumento pasado a "getOrNewThing" (config), por lo que cuando doblo la tarea puedo usarla nuevamente en "AddThenGetThing".

aquí es donde comenzó:

 export const getOrNewThing= ctx => cfg => pipe( GetThingByName(ctx), T.fold(()=>AddThenGetThing(ctx)(cfg),T.of), )(cfg);

luego se mejoró a:

 export const getOrNewThing= ctx => cfg => GetThingByName(ctx)(cfg) .fold(()=>AddThenGetThing(ctx)(cfg),T.of);

firmas:

//* GetThingByName:: (Ctx -> Object) => Task(Promise(Thing))

//* AddThenGetThing:: (Ctx -> Object) => Task(Promise(Thing))

Todo funciona, pero siento que me estoy perdiendo algo aquí. ¿Se puede simplificar esto para que sea más libre de puntos pero aún así legible?

Gracias

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!