Skip to content

Commit

Permalink
Make options optional for fetch method
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbrand committed Nov 15, 2023
1 parent 39c47a8 commit f64837a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ class Model extends EventEmitter(Object) {
/**
* Fetch the model from the server, merging the response with the model's
* local attributes. Any changed attributes will trigger a "change" event.
* @param {Options} options
* @param {Options} [options={}]
*/
fetch(options) {
fetch(options={}) {
options = Object.assign({ parse: true }, options);

const success = options.success;
Expand Down
4 changes: 2 additions & 2 deletions src/types/model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ export class Model extends Model_base {
/**
* Fetch the model from the server, merging the response with the model's
* local attributes. Any changed attributes will trigger a "change" event.
* @param {Options} options
* @param {Options} [options={}]
*/
fetch(options: Options): any;
fetch(options?: Options): any;
/**
* Set a hash of model attributes, and sync the model to the server.
* If the server returns an attributes hash that differs, the model's
Expand Down
2 changes: 1 addition & 1 deletion src/types/model.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f64837a

Please sign in to comment.