GithubHelp home page GithubHelp logo

leptos-tutorial's People

Contributors

gihrig avatar

Stargazers

 avatar  avatar

Watchers

 avatar

leptos-tutorial's Issues

`create_resource` error expected a `std::ops::Fn<()>`

Error as of tag leptos tut(lesson): 6.1 Async - Loading Data with Resources in this repo.

I'm working through the Leptos Book/Tutorial and I've hit a wall at section 6.1 Loading Data with Resources.

I have copied the Source and Cargo.toml from CodeSandbox.

This code works as expected on CodeSandbox but I'm getting a compile error on my local machine.

The full error is:
6 1-error

And the related source:
6 1-source

I have tried the CodeSandbox Source form the next two entries (6.2 Suspense, 6.3 Transition) all work as expected on CodeSandbox, but fail with similar errors relating to create_resource on my machine.

I have noted the compiler help:

    = help: the trait `std::ops::Fn<()>` is not implemented for `ReadSignal<{integer}>`
    = note: wrap the `ReadSignal<{integer}>` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `leptos::create_resource`

and fiddled around trying to implement its suggestion to no avail. But I really don't know enough about rust or leptos at this point to make sense of all this. I'm pretty much just guessing.


My environment:

rustc -V: rustc 1.73.0-nightly (474709a9a 2023-08-03)

trunk -V: trunk 0.17.2

macOS: Monterey 12.6.7

Cargo.toml:

[package]
name = "app"
version = "0.1.0"
edition = "2021"

[dependencies]
leptos = { git = "https://github.com/leptos-rs/leptos" }
console_log = "0.2"
log = "0.4"
console_error_panic_hook = "0.1.7"
gloo-timers = { version = "0.2", features = ["futures"] }

I tried rolling back to rust v 1.69 and leptos 0.4.0 and still got the same result.

Any suggestions, hints or guess are much appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.