#[macro_export]
macro_rules! total_update {
($state:expr, $action:expr, {
$($variant:pat => $body:expr,)*
_ => $default:expr
}) => {{
match $action {
$($variant => $body,)*
_ => $default,
}
}};
}
#[macro_export]
macro_rules! arbitrary_msg {
($name:ident { $($variant:ident),* $(,)? }) => {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum $name {
$($variant,)*
}
impl $name {
pub fn all() -> &'static [$name] {
&[$(Self::$variant,)*]
}
}
};
}
#[macro_export]
macro_rules! reducers {
($($r:expr),+ $(,)?) => {
$crate::reducer::CombineReducers((
$( $crate::reducer::coerce_fn($r) ),+
))
};
}