resourcerer 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/model.js CHANGED
@@ -240,10 +240,7 @@ export default class Model {
240
240
  if (!options.wait) {
241
241
  this.set(attrs, options);
242
242
  } else {
243
- // sneaky: this will show up at this point if you .toJSON(), but it will not
244
- // be associated with an update. this is so that in the sync method, they can get all
245
- // attributes via .toJSON()
246
- this.attributes = {...this.attributes, ...attrs};
243
+ options.attrs = {...this.attributes, ...attrs};
247
244
  }
248
245
 
249
246
  options.method = this.isNew() ? 'POST' : options.patch ? 'PATCH' : 'PUT';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resourcerer",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "repository": "github.com/noahgrant/resourcerer",
5
5
  "description": "Declarative data-fetching and caching framework for React",
6
6
  "keywords": [
@@ -314,7 +314,7 @@ describe('Model', () => {
314
314
 
315
315
  result = model.save({three: 'three'}, {wait: true});
316
316
  expect(callback).not.toHaveBeenCalled();
317
- expect(model.toJSON()).toEqual({one: 'one', three: 'three'});
317
+ expect(model.toJSON()).toEqual({one: 'one'});
318
318
 
319
319
  await result;
320
320