Last active
May 14, 2020 12:00
-
-
Save lifeart/edab79a0d0525d8dd8b8de1dbf82c527 to your computer and use it in GitHub Desktop.
New Twiddle
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 default Ember.Component.extend({ | |
chunkedItems: Ember.computed('items', function(){ | |
return this.items; | |
}), | |
fragment: document.createDocumentFragment(), | |
init() { | |
this._super(...arguments); | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
//console.log(mutation); | |
}); | |
}); | |
var config = { attributes: true, childList: true, subtree: true, characterData: true }; | |
observer.observe(document.getElementById('mutations'), config); | |
} | |
}); |
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 default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
itemsCount: 5000, | |
shouldRenderItems: false, | |
items: Ember.computed('itemsCount', function(){ | |
return new Array(parseInt(this.itemsCount)).fill(null).map((e, i)=>{ return { id: i }; }); | |
}), | |
actions: { | |
renderItems() { | |
this.toggleProperty('shouldRenderItems'); | |
} | |
} | |
}); |
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 appendFragment([fragment, node]/*, hash*/) { | |
console.log('appendFragment', fragment, node); | |
node.appendChild(fragment); | |
return ''; | |
} | |
export default Ember.Helper.helper(appendFragment); |
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 consoleTimeEnd([name]/*, hash*/) { | |
console.timeEnd(name); | |
return ''; | |
} | |
export default Ember.Helper.helper(consoleTimeEnd); |
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 consoleTime([name]/*, hash*/) { | |
console.time(name); | |
return ''; | |
} | |
export default Ember.Helper.helper(consoleTime); |
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 fragmentForNode(params/*, hash*/) { | |
return document.createDocumentFragment(); | |
} | |
export default Ember.Helper.helper(fragmentForNode); |
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": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment