Skip to content

L.get has unexpected behavior #217

Description

@pete-murphy

Unless I'm missing something, L.get behaves differently from Lodash's _.get (and from an equivalent implementation in Ramda) in this minimal example (using @apollo/react-hooks): https://codesandbox.io/s/thirsty-einstein-frv16

...
import * as L from "partial.lenses";
import * as _ from "lodash/fp";

...

function App() {
  const { data } = useQuery(EXAMPLE, { client });
  return (
    <div className="App">
      <div>
        <h2>This works</h2>
        <Pre>{_.get(["continents"])(data)}</Pre>
      </div>
      <div>
        <h2>This doesn't work</h2>
        <Pre>{L.get(["continents"])(data)}</Pre>
      </div>
    </div>
  );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions