Open sphinxc0re opened 6 years ago
As a Holochain-core dev I want to write reducers in a DSL-like fashion.
// TODO: write macro for DRY reducer functions macro_rules! reducer { ($func_name:ident) => ( fn reducer(old_state: Rc<$state_type>, action: &_Action) -> Rc<$state_type> { // The `stringify!` macro converts an `ident` into a string. println!("You called {:?}()", stringify!($func_name)); } ) }
As a Holochain-core dev I want to write reducers in a DSL-like fashion.