Skip to content

Commit

Permalink
release 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
maccesch committed Jun 15, 2023
1 parent 18ff2f4 commit dd5cdfd
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 🚀

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/>
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
12 changes: 2 additions & 10 deletions examples/use_interval/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
}
}
Expand Down
12 changes: 4 additions & 8 deletions src/use_interval.rs
Original file line number Diff line number Diff line change
@@ -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.
///
Expand Down Expand Up @@ -103,7 +99,7 @@ pub struct UseIntervalOptions {
impl Default for UseIntervalOptions {
fn default() -> Self {
Self {
immediate: false,
immediate: true,
callback: Box::new(|_: u64| {}),
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/utils/pausable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::cell::Cell;
use leptos::{ReadSignal, Signal};
use leptos::Signal;

/// Pausable effect
pub struct Pausable<PauseFn, ResumeFn>
Expand Down

0 comments on commit dd5cdfd

Please sign in to comment.