release 0.3.1

This commit is contained in:
Maccesch 2023-06-15 20:30:05 +01:00
parent 18ff2f49e1
commit dd5cdfdcfa
7 changed files with 11 additions and 24 deletions

View file

@ -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 🚀

View file

@ -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"]

View file

@ -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/>

View file

@ -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>

View file

@ -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>
}
}

View file

@ -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| {}),
}
}

View file

@ -1,5 +1,4 @@
use std::cell::Cell;
use leptos::{ReadSignal, Signal};
use leptos::Signal;
/// Pausable effect
pub struct Pausable<PauseFn, ResumeFn>