-
Notifications
You must be signed in to change notification settings - Fork 309
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
add one-import usage for sttp #125
Conversation
The |
import scala.concurrent.duration._ | ||
import scala.language.higherKinds | ||
|
||
trait SttpApi extends sttpExtensions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe sttpExtensions
could now become SttpApiExtensions
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but this was the existing name so I feel changing it is kind of orthogonal to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was for consistency, as previously these were extensions to the sttp
package object. Hence the lower-case name prefix :)
@@ -0,0 +1,5 @@ | |||
package com.softwaremill.sttp | |||
|
|||
object simpleApi extends SttpApi{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would be leaning towards calling this package quick
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
Thanks for the PR! I left two naming notes. Also, I think the README and docs can be updated with the new usage? |
@mukel if you would know how to write a node backend, that would be great :) |
I renamed the things to |
capitalized SttpExtensions |
#121
I basically moved the package object into a trait, made the package object inherit from it, and added two
simpleApi
objects (one on JVM, one on JS) that let youimport com.softwaremill.sttp.simpleApi._
and get the normal stuff imported into scope together with a default configuration of the relevant backend (HttpUrlConnectionBackend
orFetchBackend
)Seems to work:
let's see what CI says