Comments (5)
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.
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.
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.
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.
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)
- Popovers with Scrollable inside are immediately closed when opened HOT 1
- Add "recover" method
- Instance method `.toEither` HOT 15
- fold pending parameter should provide progress HOT 2
- question about representing "pending+data" state HOT 4
- 'io-ts' and 'io-ts-types' are missing HOT 8
- RemoteData Applicative ordering HOT 32
- Synthetic fold HOT 7
- Possible bug in remote-data-io.ts HOT 1
- fp-ts@2 HOT 1
- Versioning
- Provide version with ES modules HOT 3
- Rewrite imports in `es6` folder
- Update index exports HOT 1
- sequenceS and sequenceT from fp-ts Apply gives type errors HOT 11
- Import without `/lib` or `/es6` paths like fp-ts now does HOT 8
- Suggestion: constructors should receive all generics HOT 3
- `TaskRemoteData` HOT 1
- Question about pending state HOT 1
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 remote-data-ts.