Comments (5)
Thanks for the kind words. Could you post the code where you use it?
from leptos-use.
of course! this is the only location where I use the cookie:
pub fn get_signed_in_signals() -> (Signal<Option<bool>>, WriteSignal<Option<bool>>) {
let (cookie, set_cookie) = use_cookie_with_options::<bool, FromToStringCodec>(
"signed_in",
UseCookieOptions::default()
.max_age(86400_000) // one day
.same_site(SameSite::Strict),
);
if cookie().is_none() {
set_cookie.set(Some(false));
}
(cookie, set_cookie)
}
from leptos-use.
The warning should be gone if you change the line
if cookie().is_none() {
to
if cookie.get_untracked().is_none() {
Or make sure that you use your function always in a reactive context which I'm pretty sure you're not doing right now.
from leptos-use.
Ah, okay! So I am using the setters and getters in a reactive context but since the instantiation of them is not reactive, the warning is shown. Warnings gone :)
Odd that the warning didn't reference the file where it came from! Sorry about that.
from leptos-use.
No worries! I'm glad you were able to find it.
from leptos-use.
Related Issues (20)
- Demo for `use_cookie` in the book is misaligned
- Add `use_web_lock`
- Using `leptos_use` with fermyon spin HOT 2
- Use_clipboard is missing from the docs HOT 3
- reexport `cookie::SameSite` HOT 1
- Support `position:absolute` for `use_draggable_with_options` HOT 1
- `use_local_storage` doesn't work with `Option` or `Vec` HOT 4
- `use_event_source` cannot retrieve error due to `StringCodec::Error` not implementing `Clone`
- Feature request: `use_locale` HOT 5
- UseDisplayMediaOptions is always Default. HOT 2
- Websocket doesn't stay open? HOT 2
- Add heart beat option to use_websocket
- [Bug] on_click_outside lint message appears even though it (probably) shouldn't HOT 5
- use_clipboard text is not shown HOT 2
- use_infinite_scroll constantly loading HOT 1
- Add support for client hints HOT 6
- `use_infinite_scroll` stops calling `on_load_more` after shrinking content
- Add option to save default value to `use_storage`
- Try and set cookie headers on the server
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leptos-use.