mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 09:09:21 -05:00
release 0.3.1
This commit is contained in:
parent
18ff2f49e1
commit
dd5cdfdcfa
7 changed files with 11 additions and 24 deletions
|
@ -3,7 +3,7 @@
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [0.3.1] - 2023-06-15
|
||||||
|
|
||||||
### New Functions 🚀
|
### New Functions 🚀
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "leptos-use"
|
name = "leptos-use"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Marc-Stefan Cassola"]
|
authors = ["Marc-Stefan Cassola"]
|
||||||
categories = ["gui", "web-programming"]
|
categories = ["gui", "web-programming"]
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<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://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"><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/-docs%20%26%20demos-%239A233F" alt="Docs & Demos"></a>
|
||||||
<a href="https://leptos-use.rs"><img src="https://img.shields.io/badge/-31%20functions-%23EF3939" alt="31 Functions" /></a>
|
<a href="https://leptos-use.rs"><img src="https://img.shields.io/badge/-33%20functions-%23EF3939" alt="33 Functions" /></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
<p>
|
<p>
|
||||||
<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://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="./get_started.html"><img src="https://img.shields.io/badge/-docs%20%26%20demos-%239A233F" alt="Docs & Demos"></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/-31%20functions-%23EF3939" alt="31 Functions" /></a>
|
<a href="./functions.html"><img src="https://img.shields.io/badge/-33%20functions-%23EF3939" alt="33 Functions" /></a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
|
@ -4,19 +4,11 @@ use leptos_use::{use_interval, UseIntervalReturn};
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
fn Demo(cx: Scope) -> impl IntoView {
|
fn Demo(cx: Scope) -> impl IntoView {
|
||||||
let UseIntervalReturn {
|
let UseIntervalReturn { counter, .. } = use_interval(cx, 200);
|
||||||
counter,
|
|
||||||
reset,
|
|
||||||
is_active,
|
|
||||||
pause,
|
|
||||||
resume
|
|
||||||
} = use_interval(cx, 200);
|
|
||||||
|
|
||||||
let (counter_read, _) = create_signal(cx, move || counter());
|
|
||||||
|
|
||||||
view! { cx,
|
view! { cx,
|
||||||
<div>
|
<div>
|
||||||
<p>"Interval fired: " { counter_read() }</p>
|
<p>"Interval fired: " { counter }</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
use crate::utils::{CloneableFn, CloneableFnWithArg, Pausable};
|
use crate::utils::{CloneableFnWithArg, Pausable};
|
||||||
use crate::{use_interval_fn, use_interval_fn_with_options, watch, UseIntervalFnOptions};
|
use crate::{use_interval_fn_with_options, UseIntervalFnOptions};
|
||||||
use default_struct_builder::DefaultBuilder;
|
use default_struct_builder::DefaultBuilder;
|
||||||
use leptos::leptos_dom::helpers::IntervalHandle;
|
|
||||||
use leptos::*;
|
use leptos::*;
|
||||||
use std::cell::Cell;
|
|
||||||
use std::marker::PhantomData;
|
|
||||||
use std::rc::Rc;
|
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
/// Reactive counter increases on every interval.
|
/// Reactive counter increases on every interval.
|
||||||
///
|
///
|
||||||
|
@ -103,7 +99,7 @@ pub struct UseIntervalOptions {
|
||||||
impl Default for UseIntervalOptions {
|
impl Default for UseIntervalOptions {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
immediate: false,
|
immediate: true,
|
||||||
callback: Box::new(|_: u64| {}),
|
callback: Box::new(|_: u64| {}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use std::cell::Cell;
|
use leptos::Signal;
|
||||||
use leptos::{ReadSignal, Signal};
|
|
||||||
|
|
||||||
/// Pausable effect
|
/// Pausable effect
|
||||||
pub struct Pausable<PauseFn, ResumeFn>
|
pub struct Pausable<PauseFn, ResumeFn>
|
||||||
|
|
Loading…
Add table
Reference in a new issue