-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No interface if only one implementation
- Loading branch information
Showing
5 changed files
with
16 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package me.relph.domain.hub | ||
|
||
import dev.forkhandles.result4k.* | ||
import me.relph.domain.port.UserStorage | ||
|
||
typealias UserId = String | ||
|
||
class Hub(private val users: UserStorage) { | ||
fun greet(userId: UserId) = users.byId(userId).map{"hello ${it.name}"}.flatMapFailure { Success("hello anon") } | ||
fun ping() = Success("pong") | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters