TWorldIsNButThis

能否用 lodash/fp 表达 find one or get first? point free 且 lazy 的那种

  •  
  •   TWorldIsNButThis · Mar 7, 2022 · 1152 views
    This topic created in 1531 days ago, the information mentioned may be changed or developed.

    正常的写法是

    const findOneOrGetFirst = (predicate) => (someTypeList) => someTypeList.find(predicate) || someTypeList[0]
    

    这种写法能否转成 point free 的形式呢? 也就是用函数的组合表达那个逻辑或

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1404 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:06 · PVG 01:06 · LAX 10:06 · JFK 13:06
    ♥ Do have faith in what you're doing.