History

Sanity-check decaffeinate app.View

Simon Legner committed 2 years ago

Commit 29b09161 parent 3ea10501 file · +2 −11Browse files

Unified · Split

assets/javascripts/views/view.js+2−11
@@ -1,12 +1,3 @@
1// TODO: This file was created by bulk-decaffeinate.
2// Sanity-check the conversion and remove this comment.
3/*
4 * decaffeinate suggestions:
5 * DS101: Remove unnecessary use of Array.from
6 * DS102: Remove unnecessary code created because of implicit returns
7 * DS207: Consider shorter variations of null checks
8 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
9 */
10app.View = class View extends Events {1app.View = class View extends Events {
11 constructor(el) {2 constructor(el) {
12 super();3 super();
@@ -152,12 +143,12 @@ app.View = class View extends Events { · 139 unmodified lines
152 }143 }
153 144
154 tmpl(...args) {145 tmpl(...args) {
155 return app.templates.render(...Array.from(args || []));146 return app.templates.render(...args);
156 }147 }
157 148
158 delay(fn, ...args) {149 delay(fn, ...args) {
159 const delay = typeof args[args.length - 1] === "number" ? args.pop() : 0;150 const delay = typeof args[args.length - 1] === "number" ? args.pop() : 0;
160 return setTimeout(fn.bind(this, ...Array.from(args)), delay);151 return setTimeout(fn.bind(this, ...args), delay);
161 }152 }
162 153
163 onDOM(event, callback) {154 onDOM(event, callback) {