Code Monkey home page Code Monkey logo

Comments (13)

donnut avatar donnut commented on August 23, 2024

Can you check if the definition works for you?

from npm-ramda.

brianbondlink avatar brianbondlink commented on August 23, 2024

@donnut yes that is the definition we had prior to updating the definition which worked fine for nested evolutions.

from npm-ramda.

donnut avatar donnut commented on August 23, 2024

I created an alternative typing. Can you check if this works for you? And maybe share the snipped you encountered problems with?

from npm-ramda.

donnut avatar donnut commented on August 23, 2024

@brianbondlink do you have a snippet to share 😉

from npm-ramda.

brianbondlink avatar brianbondlink commented on August 23, 2024

Sorry @donnut missed your last reply. I haven't gotten to test the typing yet, but for a snippet take a look at the ramda docs for evolve. It demonstrates the nested evolution that was broken initially

from npm-ramda.

donnut avatar donnut commented on August 23, 2024

Ok, thanks. The ramda doc example is fixed with this modification.

from npm-ramda.

brianbondlink avatar brianbondlink commented on August 23, 2024

Excellent thank you

from npm-ramda.

donnut avatar donnut commented on August 23, 2024

I'll update the code this weekend. Thanks for reporting the issue 👍

from npm-ramda.

donnut avatar donnut commented on August 23, 2024

@brianbondlink
done in bc6c44a

from npm-ramda.

brianbondlink avatar brianbondlink commented on August 23, 2024

Thanks!

from npm-ramda.

donnut avatar donnut commented on August 23, 2024

The test of evolve fails after all (not in the atom-editor?). Has to do with [index: string] key.

from npm-ramda.

jcristovao avatar jcristovao commented on August 23, 2024

I am also having problems with the definition currently on master.
To me this:

     interface xpto  { a: number, b: number };
     var test : xpto = { a: 1, b: 2};
     const a3 : xpto = R.evolve({ a: R.add(1)}, test );

Is totally valid code, that typescript rejects with:

TS2322: Type 'Nested<xpto>' is not assignable to type 'xpto'.Property 'a' is missing in type 'Nested<xpto>'. [typescript/tsc]

With the alternative it works:

evolve(transformations: {[index: string]: (value: any) => any}, obj: any): any;
evolve(transformations: {[index: string]: (value: any) => any}): (obj: any) => any;

from npm-ramda.

KiaraGrouwstra avatar KiaraGrouwstra commented on August 23, 2024

Right now, both versions of the typing are in, meaning all tests are passing. However, that doesn't mean this is resolved yet; our currently having to resort to any typings here shows that there is room for improvement in our inference.

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.