mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-22 16:49:22 -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/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
## [0.3.1] - 2023-06-15
|
||||
|
||||
### New Functions 🚀
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "leptos-use"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
edition = "2021"
|
||||
authors = ["Marc-Stefan Cassola"]
|
||||
categories = ["gui", "web-programming"]
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<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://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>
|
||||
|
||||
<br/>
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
<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="./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>
|
||||
</div>
|
|
@ -4,19 +4,11 @@ use leptos_use::{use_interval, UseIntervalReturn};
|
|||
|
||||
#[component]
|
||||
fn Demo(cx: Scope) -> impl IntoView {
|
||||
let UseIntervalReturn {
|
||||
counter,
|
||||
reset,
|
||||
is_active,
|
||||
pause,
|
||||
resume
|
||||
} = use_interval(cx, 200);
|
||||
|
||||
let (counter_read, _) = create_signal(cx, move || counter());
|
||||
let UseIntervalReturn { counter, .. } = use_interval(cx, 200);
|
||||
|
||||
view! { cx,
|
||||
<div>
|
||||
<p>"Interval fired: " { counter_read() }</p>
|
||||
<p>"Interval fired: " { counter }</p>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
use crate::utils::{CloneableFn, CloneableFnWithArg, Pausable};
|
||||
use crate::{use_interval_fn, use_interval_fn_with_options, watch, UseIntervalFnOptions};
|
||||
use crate::utils::{CloneableFnWithArg, Pausable};
|
||||
use crate::{use_interval_fn_with_options, UseIntervalFnOptions};
|
||||
use default_struct_builder::DefaultBuilder;
|
||||
use leptos::leptos_dom::helpers::IntervalHandle;
|
||||
|
||||
use leptos::*;
|
||||
use std::cell::Cell;
|
||||
use std::marker::PhantomData;
|
||||
use std::rc::Rc;
|
||||
use std::time::Duration;
|
||||
|
||||
/// Reactive counter increases on every interval.
|
||||
///
|
||||
|
@ -103,7 +99,7 @@ pub struct UseIntervalOptions {
|
|||
impl Default for UseIntervalOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
immediate: false,
|
||||
immediate: true,
|
||||
callback: Box::new(|_: u64| {}),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use std::cell::Cell;
|
||||
use leptos::{ReadSignal, Signal};
|
||||
use leptos::Signal;
|
||||
|
||||
/// Pausable effect
|
||||
pub struct Pausable<PauseFn, ResumeFn>
|
||||
|
|
Loading…
Add table
Reference in a new issue