Skip to content

Outdated code in tut 5 #1

@TheCoreMan

Description

@TheCoreMan

Hey dude! Great tutorial, thanks!

Just wanted to let you know that in stage 5, you have this code:

impl HostipService {
    pub fn new() -> Self {
        Self {
            fetchserv: FetchService::new(),
        }
    }

But there's no option to do this, I assume since yew got quite a lot of updates since your tutorial. Now instead of creating the service all you need to do is use FetchService and call the fetch function.

use yew::services::fetch::{FetchService, ....};

FetchService::fetch(request, handler.into()).unwrap()

My env info:

❯ cargo version
cargo 1.45.1 (f242df6ed 2020-07-22)
❯ rustc --version
rustc 1.45.2 (d3fb005a3 2020-07-31)

and in Cargo.toml:

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
yew = "0.17"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions