This gist shows examples of how to handle different types of form elements with the new stache binding syntax in CanJS 2.3.
This file contains hidden or 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 QUnit from 'steal-qunit'; | |
QUnit.module('Tournament Details ViewModel', { | |
beforeEach: function () { | |
localStorage.clear(); | |
} | |
}); | |
test('should load a tournament', (assert) => { | |
let done = assert.async(), |
This file contains hidden or 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
<script src="../node_modules/steal/steal.js"> | |
window.rerun = true; | |
function rerunIfSuccessful() { | |
var result = document.getElementById('qunit-testresult'); | |
var failed = result.getElementsByClassName('failed'); | |
if (!failed.length) { | |
setTimeout(rerunIfSuccessful, 4000); | |
} else if (failed[0].innerHTML === "0" && window.rerun) { | |
location.reload(true); | |
} |
This file contains hidden or 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 npm = require('npm'); | |
const publishTimes = {}; | |
function getInfo(name, version) { | |
return new Promise((resolve) => { | |
npm.info(name, (err, info) => { | |
const times = typeof info[version] === 'object' ? info[version].time : {}; | |
resolve(`${name}@${version}|${times[version]}`);; | |
}); |
This file contains hidden or 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 clone from 'steal-clone'; |
This file contains hidden or 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
return new Proxy(this, { | |
get: function(target, prop) { | |
var funcOrProp = target[prop]; | |
if (typeof funcOrProp === 'function') { | |
return function() { | |
var result = funcOrProp.apply(target, arguments); | |
console.log(prop + '(' + [].join.call(arguments, ',') + ') -> ' + JSON.stringify(result)); | |
return result; | |
} |
This file contains hidden or 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
npm uninstall -g donejs-cli | |
cd path/to/donejs-cli | |
npm link | |
cd path/to/generator-donejs | |
npm link | |
DEBUG=* node --inspect --debug-brk /path/to/bin/donejs add app |
This file contains hidden or 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
This is a set of codemods |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Lazy Values</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
OlderNewer