Added
replace option for fetchRecords, fetchRecord, and saveRecord action creators. When replace: true, individual records from the API response completely overwrite their existing versions in the store instead of being deep-merged. Records not in the response are preserved. Default behavior (deep merge) is unchanged.
Fixed
- Corrected
saveRecord TypeScript definition to match implementation signature.
- Fixed TypeScript compilation errors in selectors caused by nullable
ApiRecord.id.
Usage
// Deep merge (default) -- existing attributes not in response are preserved
fetchRecords('articles', { page: 1 });
// Replace -- each returned record completely overwrites its existing version
fetchRecords('articles', { page: 1 }, { replace: true });
// Also works with fetchRecord and saveRecord
fetchRecord('articles', 5, { include: 'author' }, { replace: true });
saveRecord(record, { replace: true });