more fullstack cleanups: loaders serialize, ServeConfig only (#4785)
* some opinionated cleanups in dioxus-server * add serialize to loader * add `result` to Resource * clippy * fix * writable memos, resources, `onmount`, `.pending`, and `.value()` on actions * fix compile issues * fix typo
This commit is contained in:
1 parent
a3e40a5ea2
commit
7102bc3b6a
33 files changed
+2085
-672
No files matched your search
@@ -1,6 +1,6 @@
|
||||
use crate::CopyValue;
|
||||
use crate::{read::Readable, ReadableRef, Signal};
|
||||
use crate::{read::Readable, write_impls, ReadableRef, Signal};
|
||||
use crate::{read_impls, GlobalMemo, ReadableExt, WritableExt};
|
||||
use crate::{CopyValue, Writable};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
ops::Deref,
|
||||
@@ -214,6 +214,19 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: 'static + PartialEq> Writable for Memo<T> {
|
||||
type WriteMetadata = <Signal<T> as Writable>::WriteMetadata;
|
||||
|
||||
fn try_write_unchecked(
|
||||
&self,
|
||||
) -> Result<crate::WritableRef<'static, Self>, generational_box::BorrowMutError>
|
||||
where
|
||||
Self::Target: 'static,
|
||||
{
|
||||
self.inner.try_write_unchecked()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> IntoAttributeValue for Memo<T>
|
||||
where
|
||||
T: Clone + IntoAttributeValue + PartialEq + 'static,
|
||||
@@ -250,6 +263,7 @@ where
|
||||
}
|
||||
|
||||
read_impls!(Memo<T> where T: PartialEq);
|
||||
write_impls!(Memo<T> where T: PartialEq);
|
||||
|
||||
impl<T> Clone for Memo<T> {
|
||||
fn clone(&self) -> Self {
|
||||
|
||||
Reference in new issue
Block a user