Skip to content

Commit

Permalink
RecursiveReducer reduces parent _after_ children
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoods committed Dec 18, 2024
1 parent ce8da2e commit 3d8bace
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ pub fn derive_macro(identifier: Ident, data: DataEnum) -> TokenStream {
action: Self::Action,
send: impl composable::Effects<Self::Action>,
) {
<Self as RecursiveReducer>::reduce(self, action.clone(), send.clone());

#[allow(unreachable_patterns)]
match self {
#( #child_reducers )*
_ => {}
}

<Self as RecursiveReducer>::reduce(self, action.clone(), send.clone());
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ pub fn derive_macro(identifier: Ident, data: DataStruct) -> TokenStream {
action: Self::Action,
send: impl composable::Effects<Self::Action>,
) {
<Self as RecursiveReducer>::reduce(self, action.clone(), send.clone());

#( #child_reducers )*

<Self as RecursiveReducer>::reduce(self, action.clone(), send.clone());
}
}
};
Expand Down

0 comments on commit 3d8bace

Please sign in to comment.