Coder Social home page Coder Social logo

Comments (5)

sutarmin avatar sutarmin commented on June 8, 2024 1

hey, @anthonyjoeseph , thanks for your thoughts! No doubts it's a nice thing to have such helper utilities, but I agree with @raveclassic here that this is not related to core RemoteData logic and should be placed in some external library/end code.

from remote-data-ts.

raveclassic avatar raveclassic commented on June 8, 2024

Thanks for suggestion and sorry for such long answer. Unfortunately I don't think it's a good idea to add monocle-ts to dependencies. Yeah I'm ok with io-ts because it is related to the data structure (serialization/deserialization). But I don't see any relation to optics especially if the suggested function is trivial.

from remote-data-ts.

anthonyjoeseph avatar anthonyjoeseph commented on June 8, 2024

I think this addition would be appropriate, since RemoteData is an ADT, and ADTs are related to optics

I think adding optics support helps uphold the isomorphism between RemoteData<E, A> and Option<Option<Either<E, A>>>

However, I understand the maintenance hassles of added dependencies, and that it is ultimately a judgement call

from remote-data-ts.

anthonyjoeseph avatar anthonyjoeseph commented on June 8, 2024

I understand that. Any thoughts about what such an external library might look like? Maybe something similar to io-ts-extras? It seems too specific for fp-ts-contrib.

Maybe we need a monocle-ts-contrib. Does something like this exist already?

Forgive me, I don't mean for this thread to become too off topic, this just seems to me like a potentially common use case (deeply nested remote data could go inside redux state, etc) and I'm not sure where's best to post this

from remote-data-ts.

anthonyjoeseph avatar anthonyjoeseph commented on June 8, 2024

FWIW both the Elm and Purescript versions of RemoteData include optics (and the Elm interface even avoids a dependency)

from remote-data-ts.

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.