mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-02-02 02:54:14 -05:00
Release 0.11.0
This commit is contained in:
parent
24020805bc
commit
0103524d27
7 changed files with 31 additions and 21 deletions
|
@ -3,7 +3,7 @@
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
## [0.11.0] - 2024-07-27
|
||||
|
||||
### New Functions 🚀
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "leptos-use"
|
||||
version = "0.10.10"
|
||||
version = "0.11.0"
|
||||
edition = "2021"
|
||||
authors = ["Marc-Stefan Cassola"]
|
||||
categories = ["gui", "web-programming"]
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<a href="https://crates.io/crates/leptos-use"><img src="https://img.shields.io/crates/v/leptos-use.svg?label=&color=%232C1275" alt="Crates.io"/></a>
|
||||
<a href="https://leptos-use.rs/server_side_rendering.html"><img src="https://img.shields.io/badge/-SSR-%236a214b" alt="SSR"></a>
|
||||
<a href="https://leptos-use.rs"><img src="https://img.shields.io/badge/-docs%20%26%20demos-%239A233F" alt="Docs & Demos"></a>
|
||||
<a href="https://leptos-use.rs"><img src="https://img.shields.io/badge/-77%20functions-%23EF3939" alt="77 Functions" /></a>
|
||||
<a href="https://leptos-use.rs"><img src="https://img.shields.io/badge/-79%20functions-%23EF3939" alt="79 Functions" /></a>
|
||||
</p>
|
||||
|
||||
<br/>
|
||||
|
@ -92,4 +92,4 @@ This will create the function file in the src directory, scaffold an example dir
|
|||
| <= 0.3 | 0.3 |
|
||||
| 0.4, 0.5, 0.6 | 0.4 |
|
||||
| 0.7, 0.8, 0.9 | 0.5 |
|
||||
| 0.10 | 0.6 |
|
||||
| 0.10, 0.11 | 0.6 |
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
<a href="https://crates.io/crates/leptos-use"><img src="https://img.shields.io/crates/v/leptos-use.svg?label=&color=%232C1275" alt="Crates.io"/></a>
|
||||
<a href="https://leptos-use.rs/server_side_rendering.html"><img src="https://img.shields.io/badge/-SSR-%236a214b" alt="SSR"></a>
|
||||
<a href="./get_started.html"><img src="https://img.shields.io/badge/-docs%20%26%20demos-%239A233F" alt="Docs & Demos"></a>
|
||||
<a href="./functions.html"><img src="https://img.shields.io/badge/-77%20functions-%23EF3939" alt="77 Functions" /></a>
|
||||
<a href="./functions.html"><img src="https://img.shields.io/badge/-79%20functions-%23EF3939" alt="79 Functions" /></a>
|
||||
</p>
|
||||
</div>
|
|
@ -8,6 +8,7 @@ crate-type = ["cdylib", "rlib"]
|
|||
|
||||
[dependencies]
|
||||
axum = { version = "0.7", optional = true }
|
||||
codee = "0.1"
|
||||
console_error_panic_hook = "0.1"
|
||||
console_log = "1"
|
||||
cfg-if = "1"
|
||||
|
|
|
@ -4,7 +4,7 @@ use leptos::*;
|
|||
use leptos_meta::*;
|
||||
use leptos_router::*;
|
||||
use leptos_use::storage::{use_local_storage, use_local_storage_with_options, UseStorageOptions};
|
||||
use leptos_use::utils::FromToStringCodec;
|
||||
use codee::string::FromToStringCodec;
|
||||
use leptos_use::{
|
||||
use_color_mode_with_options, use_cookie_with_options, use_debounce_fn, use_event_listener,
|
||||
use_interval, use_intl_number_format, use_preferred_dark, use_timestamp, use_window, ColorMode,
|
||||
|
@ -78,7 +78,7 @@ fn HomePage() -> impl IntoView {
|
|||
|
||||
let (test_cookie, _) = use_cookie_with_options::<String, FromToStringCodec>(
|
||||
"test-cookie",
|
||||
UseCookieOptions::<String, _>::default()
|
||||
UseCookieOptions::<String, _, _>::default()
|
||||
.max_age(3000)
|
||||
.default_value(Some("Bogus string".to_owned())),
|
||||
);
|
||||
|
|
|
@ -359,6 +359,8 @@ where
|
|||
#[cfg(feature = "ssr")]
|
||||
{
|
||||
if !readonly {
|
||||
let cookie_name = cookie_name.to_owned();
|
||||
|
||||
create_isomorphic_effect(move |_| {
|
||||
let value = cookie
|
||||
.with(|cookie| {
|
||||
|
@ -369,20 +371,27 @@ where
|
|||
})
|
||||
})
|
||||
.flatten();
|
||||
jar.update_value(|jar| {
|
||||
write_server_cookie(
|
||||
cookie_name,
|
||||
value,
|
||||
jar,
|
||||
max_age,
|
||||
expires,
|
||||
domain,
|
||||
path,
|
||||
same_site,
|
||||
secure,
|
||||
http_only,
|
||||
ssr_set_cookie,
|
||||
)
|
||||
|
||||
jar.update_value({
|
||||
let domain = domain.clone();
|
||||
let path = path.clone();
|
||||
let ssr_set_cookie = Rc::clone(&ssr_set_cookie);
|
||||
|
||||
|jar| {
|
||||
write_server_cookie(
|
||||
&cookie_name,
|
||||
value,
|
||||
jar,
|
||||
max_age,
|
||||
expires,
|
||||
domain,
|
||||
path,
|
||||
same_site,
|
||||
secure,
|
||||
http_only,
|
||||
ssr_set_cookie,
|
||||
)
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue