-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: platform agnosticism #44
Comments
There's a newly servant-client-core package which tries to abstract the So, if we use that library, we can get the We can drop I think Paging @3noch :) |
My thinking is that if we abstract away what does the actual async request, we could get away without including I'm thinking something like this: type AsyncRequestRunner a = GenericRequestThing -> m (Maybe a)
-- Or maybe we include async and make this `GenericRequestThing -> m (Async (Maybe a))`
clientWith :: (Reflex t, MonadIO m, PerformEvent t m) => AsyncRequestRunner a -> Dynamic t Int -> Dynamic t Bool -> Event t () -> m (Event a) Lots of hand waving. |
Yeah, I don't know if there's an easy way to do this for all |
@schell I'm sure we could come up with some sort of common "request" and "make request" abstraction that could be filled in by different reflex hosts. |
This PR against |
Although it may not be as feature complete at this point, I've created a platform agnostic rewrite. It's sufficient for my own use now, but feel free to create issues (or PRs ;) ). If you think it'd be better to merge it into this project that's also fine with me (not sure if a good idea though, considering that this is about removing dependencies) |
Would it be possible to get out of the business of Events and Dynamics altogether and have a pure function that simply converts Servant routes into |
@mightybyte It would be possible, but not very pretty. With a custom What is your need that is not served by |
@roberth Oh, that's a good point about the Request. I was more trying to think of ways to ruthlessly simplify things, but I had forgotten about the Request component. |
@mightybyte Apart from the uncurrying it's already a trivial wrapper around |
@roberth Awesome work! I'd been struggling with converting to a tuple-based API, and fitting anything |
@imalsogreg Although I appreciate the idea of a PR wrt visibility and collaboration, at this point I don't see a technical benefit of doing so. I don't see any code that I can reuse or the other way around. After reflex-servant issue 2 the API for options may become similar though, except It's also entirely possible to use both packages side by side. I've done it while migrating my app and I could have stopped half-way without any problems. Feel free to copy the code into |
How difficult would it be to make this library "platform" agnostic? This would mean removing any reference to
jsaddle
,reflex-dom
andghcjs-dom
. Doing this would make it a shoe-in forreflex-sdl2
.The text was updated successfully, but these errors were encountered: