Serialize nested (poly)variants?
I hava a store with nested reducers and nested action generators like this
// Root action in root store
type action = [
| `User(User_Store.action)
| `Customer(Customer_Store.action)
| `DevToolsUpdate('state)
];
// Customer_Store.re
type action = [
| `GetCustomerRequest(Types.ObjectId.t)
| `GetCustomerSuccess(Customer_Types.Customer.t)
| `GetCustomerFailure(string)
];
So I dispatch these like this:
dispatch(`Customer(`GetCustomerSuccess(result)));
Now, the dev tools only show this as Customer, which is better than nothing but unfortunately hides the interesting part.
Wondering if there would be a way to serialize also the inner polyvariant to get something like this out.
Customer: GetCustomerSuccess
Thanks for the nice tool again!
@TomiS: this should work out of the box, will investigate, also just to note, you may also define custom action serialize if needed.
Cool, so I assume it should also serialize nested normal variants by default. (changed the title a little)
yes, when they are not plain(with constructors)