mirror of
https://github.com/Zenithsiz/dynatos.git
synced 2026-02-04 02:18:40 +00:00
Fixed effects map being called an array in some places.
This commit is contained in:
parent
2740552a53
commit
9077404cf0
@ -16,13 +16,13 @@ where
|
||||
{
|
||||
/// Attaches an effect to this object
|
||||
fn attach_effect(&self, effect: Effect) {
|
||||
// Get the effects array, or create it, if it doesn't exist
|
||||
// Get the effects map, or create it, if it doesn't exist
|
||||
// TODO: Use an static anonymous symbol?
|
||||
let prop_name: &str = "__dynatos_effects";
|
||||
let obj = self.as_ref();
|
||||
let effects = match obj.get::<js_sys::Map>(prop_name) {
|
||||
Ok(effects) => effects,
|
||||
Err(dynatos_util::GetError::WrongType(err)) => panic!("Effects array was the wrong type: {err:?}"),
|
||||
Err(dynatos_util::GetError::WrongType(err)) => panic!("Effects map was the wrong type: {err:?}"),
|
||||
Err(dynatos_util::GetError::Missing) => {
|
||||
let effects = js_sys::Map::new();
|
||||
obj.set_prop(prop_name, &effects);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user