63 Commits

Author SHA1 Message Date
f32ec1d4ec
Improved dyn child handling of duplicate nodes.
Previously it panicked, due to it's invariants being messed with.
However, now, it simply refuses to insert a duplicate node.

If someone else messes with the invariants by removing the existing node, we also recover.
2024-02-06 09:51:54 +00:00
9ab1115f78
Replaced ObjectDefineProperty with ObjectSet. 2024-02-06 09:15:50 +00:00
e3c520afb0
Refactored all wasm_bindgen effect types in dynatos. 2024-02-06 08:34:48 +00:00
e9c4c9ad8b
Added Effect::try_new. 2024-02-06 08:32:51 +00:00
785d782ea9
Added TryOrReturn helper. 2024-02-06 08:30:25 +00:00
3adb2c67aa
Added wrapper for WeakRef. 2024-02-06 08:04:52 +00:00
c563754171
Fixed that .dyn_child would lose the position if the closure returned None. 2024-02-06 07:44:24 +00:00
f319161336
Fixed possible bug with NodeDynChild. 2024-02-05 22:41:53 +00:00
4f63e55653
Added initial support for Signal<impl ?Sized>. 2024-02-05 22:36:08 +00:00
c19c2ecddc
Reduced size of Signal.
With the previous commit, it doubled, since it had to store 2 `Rc`s, but now it stores just one.
2024-02-05 19:55:55 +00:00
bee58c76a2
Added new reactivity primitive Trigger.
`Signal<T>` now uses `T` underneath.
2024-02-05 19:52:25 +00:00
d5c96a117f
dynatos::*Dyn* extension traits now do less work if the reactive effect has no dependencies. 2024-02-04 18:02:06 +00:00
24a54dba40
Added ElementDynAttr::[with_]dyn_attr_if. 2024-02-04 15:37:49 +00:00
749cc7b42f
Added NodeWithChildren::with_child. 2024-02-04 15:34:35 +00:00
2bf93dc495
Added ElementDynAttr::[with_]dyn_attr_value. 2024-02-04 15:15:47 +00:00
54eb8d6a9d
Fixed issue with having multiple reactive children. 2024-02-04 15:10:31 +00:00
0083e62fa7
NodeDynChild now accepts a missing child. 2024-02-04 15:03:17 +00:00
db46fdf8e7
Added *_cloned wrappers to dynatos-context. 2024-02-04 15:02:55 +00:00
2f6b9e9d09
dynatos_reactive::{Signal, Effect} now implement fmt::Debug. 2024-02-04 15:02:42 +00:00
02051163c8
Fixed ElementDynAttr using wrong property name. 2024-02-04 15:02:11 +00:00
d9d9366080
Added dynatos_html::ElementWithClass. 2024-02-04 14:01:12 +00:00
e972ae461f
Added dynatos::ElementDynAttr. 2024-02-04 13:33:58 +00:00
1ae80ad1e4
Added impls for Children of tuple sizes between 0 and 10, inclusive. 2024-02-04 13:26:23 +00:00
90e12df0cf
Renamed ElementWithTextContent to NodeWithTextContent.
Renamed `ElementWithChildren` to `NodeWithChildren`.
Made the previous and `ElementWithAttr` all generic on their implemented type.
2024-02-04 13:19:18 +00:00
94a4fe3f65
Renamed ElementDynChild to NodeDynChild.
Also made it generic over the types.
2024-02-04 13:15:27 +00:00
bc8f562a42
Renamed ElementDynText to NodeDynText.
Also made it generic over the type.
2024-02-04 13:13:17 +00:00
e3dc70b725
Most web_sys fallible calls now panic on failure. 2024-02-04 12:37:36 +00:00
7c7db72348
ElementWithChildren::with_children now panics on errors by default. 2024-02-04 12:33:26 +00:00
faa8460191
ElementWithAttr::with_attr now panics on errors by default. 2024-02-04 12:29:43 +00:00
65f62e51e0
SignalSet and SignalReplace now take the value type as an argument. 2024-02-04 12:26:11 +00:00
50a99c0ac2
Location now implements the signal traits. 2024-02-04 12:00:53 +00:00
fcf29943c2
Added SignalReplace. 2024-02-04 11:51:24 +00:00
fb10a1d3de
Fixed Location not changing when the user went forwards or backwards. 2024-02-04 11:46:09 +00:00
bd7b841deb
Moved and renamed ElementEventListener to dynatos_util::EventTargetAddListener. 2024-02-04 11:35:57 +00:00
88856c4836
Added dynatos_reactive::WithDefault. 2024-02-04 11:29:39 +00:00
4afb802c11
QuerySignal now implements the signal traits. 2024-02-04 11:16:24 +00:00
6660d8bc13
Added dynatos_reactive::Signal{Get, With, Set, Update}.
`Signal` now updates the previously added traits.
2024-02-04 11:12:14 +00:00
3d8743c9dc
Added query example. 2024-02-04 11:04:31 +00:00
1ed9471985
Removed unnecessary features from router example. 2024-02-04 11:04:28 +00:00
fe5e1d3bcd
Added dynatos_router::QuerySignal. 2024-02-04 11:03:59 +00:00
0a6ee61348
Added Effect::suppressed 2024-02-04 11:00:23 +00:00
184f026fd3
Added dynatos_router::Location::{with, update}. 2024-02-04 10:56:01 +00:00
0b83a492ef
Moved several Element-specific extension traits to dynatos-html. 2024-02-04 10:05:22 +00:00
4ac4946245
Added dynatos-html. 2024-02-04 10:01:41 +00:00
6bdb983304
Added router example. 2024-02-04 09:48:24 +00:00
8ca99e2fd6
Added dynatos::ElementDynChild. 2024-02-04 09:46:24 +00:00
026b6007a3
Added dynatos-router. 2024-02-04 04:15:14 +00:00
74be0fdf25
Added dynatos-context. 2024-02-04 03:49:53 +00:00
eb5769fd03
Fixed Signal::with not being reactive. 2024-02-04 02:42:13 +00:00
87995f05b9
WeakRef::{new, deref} are now public. 2024-02-04 02:41:48 +00:00