Comments (13)
Can you check if the definition works for you?
from npm-ramda.
@donnut yes that is the definition we had prior to updating the definition which worked fine for nested evolutions.
from npm-ramda.
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.
@brianbondlink do you have a snippet to share 😉
from npm-ramda.
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.
Ok, thanks. The ramda doc example is fixed with this modification.
from npm-ramda.
Excellent thank you
from npm-ramda.
I'll update the code this weekend. Thanks for reporting the issue 👍
from npm-ramda.
@brianbondlink
done in bc6c44a
from npm-ramda.
Thanks!
from npm-ramda.
The test of evolve fails after all (not in the atom-editor?). Has to do with [index: string] key.
from npm-ramda.
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.
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)
- npm-ramda motivation HOT 4
- R.Path - Typescript error for an array of objects
- `prop` does not work with optional keys HOT 1
- curry type
- `pipeWith` is missing
- Using groupBy with path always fails typecheck
- mergeDeepRight returns incompatible if objects contain array props HOT 1
- Add dissoc(prop: number)
- `transduce` and `into` are declared with `any` and for narrow use cases in general
- R.evolve is not deriving type from curried evolver
- Generics lost on currying for higher-order functions HOT 1
- type into in typescript
- How should we type lift?
- How to type pathOr?
- Expected 0 arguments, but got 1 HOT 3
- Evolve typings
- Typescript 4: Solve a lot of our problems
- Ramda 0.27 HOT 1
- Arity limitation for R.compose's rightmost function?
- Adding support for type guards to `partition` function.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npm-ramda.