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
console.log('Starting...'); | |
console.time('Buiding test Data'); | |
const jsonData = {data:new Array(9000000)}; | |
for (let i = 0; i < 9000000; i++) { | |
jsonData.data.push(`el-${i}`); | |
} | |
const dataString = JSON.stringify(jsonData); | |
console.timeEnd('Buiding test Data'); | |
const interval = setInterval(()=>{ | |
console.log(`${Date.now()} - event loop not blocked`); |
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
const configObject = { | |
setup() { | |
const args = this.ngConstruct(); | |
const argumentsList = Array.prototype.slice.call(arguments, 0); | |
for (let i = 0; i < args.length - 1; i++) { | |
this[args[i]] = argumentsList[i]; | |
} | |
console.log('setup!!!', typeof this['$stateProvider']); | |
this.init.apply(this,argumentsList); | |
}, |
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({ | |
}); |
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' | |
}); |
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'; | |
const secondProxyMethods = { | |
get(target, prop) { | |
if (!window.counter) { | |
window.counter = 0; | |
} | |
console.log(`Чтение${a} ${prop}`); | |
window.counter++; | |
console.log(window.counter); | |
return target[prop]; |
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.Mixin.create({ | |
lastChangedAttrs: null, | |
init() { | |
this.resetLastChangedAttrs(); | |
this.initObservers(); | |
this._super(...arguments); | |
}, | |
didChangeAttrs() { | |
console.log('not implemented'); |
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
Shims: | |
https://ember-cli.com/managing-dependencies#standard-non-amd-asset | |
https://github.com/srxp10/ember-ace-shim/blob/master/vendor/ace.js | |
Others: | |
https://gist.github.com/kristianmandrup/ae3174217f68a6a51ed5 | |
https://www.bignerdranch.com/blog/creating-ember-blueprints/ | |
https://github.com/ember-cli/loader.js | |
https://github.com/broccolijs/broccoli-funnel | |
https://ember-cli.com/api/classes/Addon.html |
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
{ | |
beforeModel(params) { | |
if (this.store.peekAll('item').length > MAX_IN_MEMORY_OBJECTS) { | |
this.store.unloadAll('item'); | |
} | |
}, | |
model(params) { | |
return this.ajax('getCoordsByAdress', params.address) | |
.then(coords=>{ | |
return this.store.query('item', {x: coords.x, y: coords:y, radius: 10, maxItems: 100}) |
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
export default class AngularComponent { | |
constructor(...args) { | |
this.setupComponent(args); | |
} | |
setupComponent(args) { | |
console.log('setupComponent', args); | |
} | |
static ngConstruct() { | |
const instance = new this(); | |
return { |
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
'use strict'; | |
angular.module('common') | |
.provider('can', [ | |
'lodash', | |
function ( | |
lodash | |
) { | |
const abilities = {}; | |
const abilityAliases = {}; |