Skip to content

Instantly share code, notes, and snippets.

@jkeen
Last active April 24, 2020 15:39
Show Gist options
  • Save jkeen/2c5a8137d567876eccae42daf3d84b79 to your computer and use it in GitHub Desktop.
Save jkeen/2c5a8137d567876eccae42daf3d84b79 to your computer and use it in GitHub Desktop.
New Twiddle
import Component from '@glimmer/component';
export default class extends Component {
}
<div class="calendar-cell">
{{log 'render cell'}}
Calendar Cell: {{@value}}
</div>
import Component from '@glimmer/component';
export default class extends Component {
get cells() {
if (this.args.span == 'week') {
return [1,2,3,4,5,6,7];
}
else {
return [1];
}
}
}
{{#each this.cells as |value|}}
<CalendarCell @value={{value}}/>
{{/each}}
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = "why so many re-renders"
get calendarSpan() {
if (window.innerWidth < 700) {
return 'day';
}
else {
return 'week';
}
}
}
<CalendarGrid @span={{this.calendarSpan}}/>
{
"version": "0.17.0",
"EmberENV": {
"FEATURES": {},
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": true,
"_APPLICATION_TEMPLATE_WRAPPER": false,
"_JQUERY_INTEGRATION": false
},
"options": {
"use_pods": true,
"enable-testing": false
},
"dependencies": {
"ember": "3.17.0",
"ember-template-compiler": "3.17.0",
"ember-testing": "3.17.0"
},
"addons": {
"@glimmer/component": "1.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment