Skip to content

Commit

Permalink
fix spelling of suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburniske committed Feb 20, 2024
1 parent 08dbd81 commit cea43a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions example/start-axum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ async fn main() {
use axum::{routing::post, Router};
use leptos::*;
use leptos_axum::{generate_route_list, LeptosRoutes};
use leptos_query::with_query_supression;
use leptos_query::with_query_suppression;
use start_axum::app::*;
use start_axum::fileserv::file_and_error_handler;
use tokio::net::TcpListener;
Expand All @@ -20,7 +20,7 @@ async fn main() {
let leptos_options = conf.leptos_options;
let addr = leptos_options.site_addr;

let routes = with_query_supression(|| generate_route_list(App));
let routes = with_query_suppression(|| generate_route_list(App));

// build our application with a route
let app = Router::new()
Expand Down
6 changes: 3 additions & 3 deletions query/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use leptos::*;
use crate::{
garbage_collector::GarbageCollector,
query_cache::CacheNotification,
query_is_supressed,
query_is_suppressed,
query_observer::{ObserverKey, QueryObserver},
use_query_client,
util::time_until_stale,
Expand Down Expand Up @@ -225,7 +225,7 @@ where
let fetcher = observers.values().find_map(|f| f.get_fetcher());

if let Some(fetcher) = fetcher {
if !query_is_supressed() {
if !query_is_suppressed() {
spawn_local(execute_query(self.clone(), move |k| fetcher(k)));
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@ where
V: crate::QueryValue + 'static,
Fu: Future<Output = V>,
{
if !crate::query_is_supressed() {
if !crate::query_is_suppressed() {
match query.new_execution() {
None => {}
Some(cancellation) => {
Expand Down
6 changes: 3 additions & 3 deletions query/src/query_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ pub fn suppress_query_load(suppress: bool) {
/// use leptos_axum::*;
///
/// fn make_routes() {
/// let routes = with_query_supression(|| generate_route_list(App));
/// let routes = with_query_suppression(|| generate_route_list(App));
/// }
///
/// #[component]
/// fn App() -> impl IntoView {
/// ()
/// }
/// ```
pub fn with_query_supression<T>(f: impl FnOnce() -> T) -> T {
pub fn with_query_suppression<T>(f: impl FnOnce() -> T) -> T {
SUPPRESS_QUERY_LOAD.with(|w| {
w.set(true);
let result = f();
Expand All @@ -56,7 +56,7 @@ pub fn with_query_supression<T>(f: impl FnOnce() -> T) -> T {
})
}

pub(crate) fn query_is_supressed() -> bool {
pub(crate) fn query_is_suppressed() -> bool {
SUPPRESS_QUERY_LOAD.get()
}

Expand Down
4 changes: 2 additions & 2 deletions query/src/use_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::query::Query;
use crate::query_observer::{ListenerKey, QueryObserver};
use crate::query_result::QueryResult;
use crate::{
query_is_supressed, use_query_client, QueryOptions, QueryState, RefetchFn, ResourceOption,
query_is_suppressed, use_query_client, QueryOptions, QueryState, RefetchFn, ResourceOption,
};
use leptos::*;
use std::cell::Cell;
Expand Down Expand Up @@ -114,7 +114,7 @@ where
create_isomorphic_effect(move |_| {
query_state.track();
// If query is supressed, we have to make sure we don't refetch to avoid calling spawn_local.
if !query_is_supressed() {
if !query_is_suppressed() {
resource.refetch();
}
});
Expand Down

0 comments on commit cea43a7

Please sign in to comment.