How to use normalizr's schema.Object
with processStrategy
It looks like Object doesn't have processStrategy option like Entity
const deepNestedObj = new schema.Object({}, {
processStrategy: (value) => {
someExternalService(value);
return value;
}
})
const schema = new schema.Entity(...)
I would like to do something like this
Object does not use processStrategy. See options available in the docs.
If your object has a unique ID, the recommendation is to use
schema.Entity
and its processing strategy.Alternatively, since it looks like maybe
deepNestedObj
is something that's internal to yourschema.Entity
, you can just use theprocessStrategy
option available on the Entity.