Code Monkey home page Code Monkey logo

Comments (4)

wclr avatar wclr commented on August 23, 2024

The same problem actually with other methods:

let obj: { id: number } = { id: 1 }
R.prop<string>('id')(obj)

And in general I believe that is some limitation of TS. In this cases it is more appropriate to use not ramda but simple mapping function like (_) => _.id that will flow perfectly.

Ok this will flow:

let obj: { id: number } = { id: 1 }
R.prop('id')<string>(obj)

But how to use it with for example R.compose to get correct flow?

let obj: { id: number } = { id: 1 }
R.compose(R.prop('id')<string>)(obj) // this won't work

What do you think?

from npm-ramda.

donnut avatar donnut commented on August 23, 2024

I changed the definition of the curried find to:
find<T>(fn: (a: T) => boolean): <T>(list: T[]) => T;
and now it works as expected, see pr #91

from npm-ramda.

donnut avatar donnut commented on August 23, 2024

Concerning the 'prop'-issue. This is a know limitiation of TS. Version 1.8+ should fix that, see #10

from npm-ramda.

wclr avatar wclr commented on August 23, 2024

@donnut

Concerning the 'prop'-issue. This is a know limitiation of TS. Version 1.8+ should fix that, see #10

I'm using 2.1-dev. What signature are you talking about? It seem that string based typing is not supported.

from npm-ramda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.