Questions tagged [partial-lenses]

Partial lenses is an optics library for JavaScript.

3 questions
3
votes
1 answer

partial.lenses: how to use asynchronous operations in optics with L.collect?

I understand that partial.lenses isn't necessarily the best solution to the following problem and that's besides the point in this question. I was trying to list files from a directory using L.collect from the partial.lenses library. Goal is just to…
Esko Lahti
  • 33
  • 2
  • 3
1
vote
3 answers

Partial Lenses: Group array of objects by property, use prop value as key

I have an array of objects like this: [ { name: "Group 1", value: "Foo" }, { name: "Group 2", value: "Bar" }, { name: "Group 1", value: "Baz" } ] I'd like to use Partial Lenses library to transform these groups to keys of an object with…
jehna1
  • 3,110
  • 1
  • 19
  • 29
0
votes
1 answer

Trouble using javascript partial.lenses to obtain properties within an array

I'm trying to figure out how to create a lens that'll give me an array of the key values from within an array. Here's a simple example: const L = require('partial.lenses'); const data = [ { r: [ { d: { one: 1, …
HypeXR
  • 711
  • 2
  • 6
  • 19