Ensure you have TypeScript installed globally using this command:
npm install -g typescript
This outlines how to setup a new TypeScript project with mocha support.
const memo = (component, comparision) => { | |
let prevProps = {}; | |
let nextProps = {}; | |
let memoResult = null; | |
let initialized = false; | |
const comparisionFn = comparision ? comparision : (nextProps, prevProps) => { | |
return nextProps === prevProps; | |
} | |
const echoMachine = Machine({ | |
id: 'echo', | |
initial: 'listening', | |
states: { | |
listening: { | |
on: { | |
SPEAK: { | |
actions: send('ECHO') | |
}, | |
ECHO: { |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
<div>hola</div> |
var showTimeId; | |
var moveTimeId; | |
var slideLeaveTimeId; | |
me.$element.on('mouseenter', '[data-action="note"], [data-action="email"], [data-action="target"], [data-action="shortlist"], [data-action="task"], [data-action="floating"]', function ($e) { | |
var $target = $($e.target); | |
var mouseenter = function (e) { | |
clearTimeout(moveTimeId); | |
$(this).off(e); | |
}; |
/* | |
* This is an example build file that demonstrates how to use the build system for | |
* require.js. | |
*/ | |
({ | |
// 包含你app的顶级文件夹。如果这个选项被使用了,它假定了你的脚本都在这个路径下的子文件夹种。 | |
// 这个是非必要项。如果没有被指定,那下面的baseUrl就是找文件的锚点。 | |
// 如果这个被指定了,那么所有的app目录的文件将被复制到这个路径: | |
// 输出域和baseUrl会被假定是这个目录下的相对路径。 |
define(['jquery', | |
'troopjs-core/component/service', | |
'config'], function RouteService($, Service, config) { | |
'use strict'; | |
var URL = '/rest/data/errorlog'; | |
function log(msg, stack) { | |
if (!config.debug) { | |
var data = { |
/*! | |
* Gollum - 1.0.0-2-g7afb5e9 | |
* Copyright (c) 2012 Norman Xu <[email protected]> | |
* Licensed MIT | |
*/ | |
/** | |
* @class Gollum | |
* Load script under sandboxed execution context to isolate unsafe code. |