mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
adhoc fix js-data/js-data.d.ts and js-data-http/js-data-http-tests.ts
This commit is contained in:
@@ -28,7 +28,7 @@ ADocument.inject({ id: 5, author: 'John' });
|
||||
ADocument.inject({ id: 6, author: 'John' });
|
||||
|
||||
// bypass the data store
|
||||
adapter.updateAll(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) {
|
||||
adapter.updateAll<{ id?: number; author: string; }>(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) {
|
||||
documents[0]; // { id: 5, author: 'Johnny' }
|
||||
|
||||
// The updated documents have NOT been injected into the data store because we bypassed the data store
|
||||
@@ -37,7 +37,7 @@ adapter.updateAll(ADocument, { author: 'Johnny' }, { author: 'John' }).then(func
|
||||
});
|
||||
|
||||
// Normally you would just go through the data store
|
||||
ADocument.updateAll({ author: 'Johnny' }, { author: 'John' }).then(function (documents) {
|
||||
ADocument.updateAll<{ id?: number; author: string; }>({ author: 'Johnny' }, { author: 'John' }).then(function (documents) {
|
||||
documents[0]; // { id: 5, author: 'Johnny' }
|
||||
|
||||
// the updated documents have been injected into the data store
|
||||
@@ -164,4 +164,4 @@ ADocument.create({ author: 'John' }).then(function (document:any) {
|
||||
|
||||
// the new document has been injected into the data store
|
||||
ADocument.get(document.id); // { id: 5, author: 'John' }
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user