Giter Club home page Giter Club logo

Comments (6)

georgebonnr avatar georgebonnr commented on May 18, 2024

Trying refetch out tonight, I was just about to ask about this, to help with transformations. Any timeline, or is this a request for a PR?

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 18, 2024

@georgebonnr

I was just about to ask about this, to help with transformations.

Identity requests will allow for transformations of responses inside of connect(); however, you can use PromiseState.then() to do the same thing in the component. The only downsides of doing it that way are 1) gets applied for any prop change and 2) could clutter up the component if complex. Here's an example to transform the usersFetch to only include the verified users:

this.props.usersFetch.then(users => users.filter(u => u.verified))

Any timeline, or is this a request for a PR

I'd like to get to this soon, but we don't actually have a real need for it at this point with our own application of React Refetch, so that's slowing it down a bit. Also, there are a few different asks about transformations, handling different data types, etc, and I'd like to think about them holistically before rushing on any of them in piecemeal; however, I feel pretty confident about this one adding value with or without the others. I might even play around with it tonight since it should be fairly strait forward. With that said, anyone is welcome to open a PR for any of these enhancements.

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 18, 2024

Implemented in #36

from react-refetch.

georgebonnr avatar georgebonnr commented on May 18, 2024

Identity requests will allow for transformations of responses inside of connect(); however, you can use PromiseState.then() to do the same thing in the component.

Cool, yeah that's what I was planning on doing until identity is implemented – but no need now! 👏

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 18, 2024

Merged #36 and released in 0.7.0-beta.0. Please kick the tires :)

from react-refetch.

hnordt avatar hnordt commented on May 18, 2024

Great @ryanbrainard. Simple and very efficient 👏

from react-refetch.

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.