This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { inject as service } from '@ember/service'; | |
export default Controller.extend({ | |
confirmAction: service(), | |
api: service(), | |
async deleteRecord(record) { | |
try { | |
const result = await this.confirmAction.ask({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { task, timeout } from 'ember-concurrency'; | |
import Config from 'app/config/environment'; | |
const DEFAULT_POLL_MS = 20000; // 20 sec | |
export function pollTask(_requestTask, pollMs = DEFAULT_POLL_MS) { | |
const taskProperty = task(_requestTask).restartable(); | |
const ogTaskFn = taskProperty.taskFn; | |
taskProperty.taskFn = function*(...args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Declares a one-way read-only component property, which reads from `this.args` | |
* and falls back to default declared on the class property. | |
* @export | |
* @returns {ClassProperty} | |
*/ | |
export default function arg(target, property, descriptor) { | |
let _value; | |
if (descriptor.initializer !== null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
import validationState, { validate } from 'ember-validation-state'; | |
import { task } from 'ember-concurrency-decorators'; | |
import { timeout } from 'ember-concurrency'; | |
const validators = { | |
username: [validate('presence', { presence: true })], | |
password: [ |
OlderNewer