Skip to content
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

Improvements #7

Open
1 of 5 tasks
polytypic opened this issue Mar 21, 2018 · 2 comments
Open
1 of 5 tasks

Improvements #7

polytypic opened this issue Mar 21, 2018 · 2 comments

Comments

@polytypic
Copy link
Member

polytypic commented Mar 21, 2018

A list of some improvements to be made:

  • Switch to using Babel env preset.
    • Use different targets for Node and browsers.
  • Use Babel external-helpers plugin.
  • Switch to using pg-promise.
  • Consider introducing an abstraction for HTTP entry points.
@raine
Copy link

raine commented Aug 28, 2018

https://github.com/calmm-js/karet-express-boilerplate/blob/master/src/client/request.js#L23-L61

In the above case, wonder if just using fromPromise with fetch would be a better fit? Or would you rather use karet.xhr now?

@polytypic
Copy link
Member Author

polytypic commented Aug 28, 2018

In the above case, wonder if just using fromPromise with fetch would be a better fit? Or would you rather use karet.xhr now?

I'm not really a great fan of either the fetch or the XMLHttpRequest APIs. For that particular use case wrapping fetch would likely be ok and slightly easier. I'm not fully up to date on what the current state of browser support is.

Karet XHR was born when there was a question on how to get progress events from XHRs. I find the Karet XHR API style promising for use in reactive UIs (though still a bit rough) and we are starting to use it in production, so I'll likely be tweaking the library further in the near future and ironing out cases where usage is unnecessarily difficult. The interesting thing about Karet XHR is that it doesn't require you to use callbacks and store and mutate state for observing the XHR state/result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants