Skip to content

Instantly share code, notes, and snippets.

View poulet42's full-sized avatar

Corentin poulet42

  • Budapest
  • 08:27 (UTC +02:00)
View GitHub Profile
@poulet42
poulet42 / router.js
Last active February 1, 2023 11:57 — forked from sglanzer-deprecated/router.js
Sync and async routing
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('parent', function() {
import DS from "ember-data";
export default DS.JSONAPIAdapter.extend();
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
import Component from '@glimmer/component';
import { dropTask, restartableTask } from 'ember-concurrency';
import { tracked } from '@glimmer/tracking';
export default class extends Component {
@tracked selectedCountry;
countries = [
"france",
"italy",
<button local-class="run" type="button" {{on "click" (perform this.countToTenTask)}}>Run the global countToTenTask via a local task</button>
{
/*
// Place your snippets for Javascript (Babel) here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
;(function($, document, window, undefined) {
var defaultOptions = {
endpoint: null,
transformResponse: function(response) {return response;},
method: 'GET',
mod: 'default'
},
pluginName = 'komplete',
pluginVersion = "0.0.1";