Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override fun componentDidMount() {
- window.fetch("/api/hello")
- .then { response ->
- response.text().then { text ->
- setState {
- message = JSON.parse<HelloResponse>(text).message
- }
- }
- .catch {
- setState {
- message = "error parsing json"
- }
- }
- }
- .catch {
- setState {
- message = "error fetch from Hello Service"
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement