Fix cargo check on examples

This commit is contained in:
Jonathan Kelley committed 2024-01-30 17:59:57 -08:00
1 parent 0bd9692e45
commit a72c035de4
42 files changed
+95 -145

No files matched your search

+3 -3
View File
@@ -19,12 +19,12 @@ impl<R: Eq + Hash> Comparer<R> {
///
/// Generally, you shouldn't need to use this hook. Instead you can use [`crate::use_memo`]. If you have many values that you need to compare to a single value, this hook will change updates from O(n) to O(1) where n is the number of values you are comparing to.
pub fn new(mut f: impl FnMut() -> R + 'static) -> Comparer<R> {
let mut subscribers: CopyValue<FxHashMap<R, Signal<bool>>> =
let subscribers: CopyValue<FxHashMap<R, Signal<bool>>> =
CopyValue::new(FxHashMap::default());
let mut previous = CopyValue::new(None);
Effect::new(move || {
let mut subscribers = subscribers.read();
let subscribers = subscribers.read();
let mut previous = previous.write();
if let Some(previous) = previous.take() {
@@ -79,7 +79,7 @@ impl<R: Eq + Hash, S: Storage<SignalData<bool>>> Comparer<R, S> {
/// Returns a signal which is true when the value is equal to the value passed to this function.
pub fn equal(&mut self, value: R) -> ReadOnlySignal<bool, S> {
let mut subscribers = self.subscribers.write();
let subscribers = self.subscribers.write();
match subscribers.get(&value) {
Some(&signal) => signal.into(),
+2 -1
View File
@@ -3,7 +3,7 @@ use crate::write::Writable;
use crate::Write;
use dioxus_core::prelude::{IntoAttributeValue, ScopeId};
use generational_box::{AnyStorage, GenerationalRef, UnsyncStorage};
use std::{cell::Ref, io::prelude::Read, mem::MaybeUninit, ops::Deref};
use std::{cell::Ref, mem::MaybeUninit, ops::Deref};
use super::get_global_context;
use crate::{MappedSignal, Signal};
@@ -43,6 +43,7 @@ impl<T: 'static> GlobalSignal<T> {
}
}
/// Write this value
pub fn write(&self) -> Write<T, UnsyncStorage> {
self.signal().write()
}
+1
View File
@@ -242,6 +242,7 @@ impl<T: 'static, S: Storage<SignalData<T>>> Signal<T, S> {
}
}
/// Unsubscribe this scope from the signal's effect list
pub fn unsubscribe(&self, scope: ScopeId) {
self.inner
.read()