-
-
Save theseyi/719c2bb392295ed363f9d7df4f3460d4 to your computer and use it in GitHub Desktop.
concurrency onerror
This file contains 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 Ember from 'ember'; | |
import { task, timeout } from 'ember-concurrency'; | |
export default Ember.Component.extend({ | |
isRunning: Ember.computed.reads('theTask.isRunning'), | |
error: Ember.computed.reads('theTask.last.error'), | |
theTask: task(function* () { | |
console.count('task performed'); | |
//yield timeout(1000); | |
throw new Error('bork'); | |
}).drop() | |
}); |
This file contains 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 Ember from 'ember'; | |
export function initialize() { | |
Ember.onerror = function(error) { | |
console.count('onerror'); | |
//console.log(error); | |
}; | |
} | |
export default { | |
name: 'custom-onerror', | |
initialize | |
}; |
This file contains 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
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-local-storage": "^1.7.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment