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
<script> | |
let m = { x: 0, y: 0 }; | |
function handleMousemove(event) { | |
m.x = event.clientX; | |
m.y = event.clientY; | |
} | |
</script> | |
<div on:mousemove={handleMousemove}> |
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 React, { useState, useCallback, useEffect, useRef } from 'react'; | |
function useEventListener(eventName, handler, element = window) { | |
// Create a ref that stores handler | |
const savedHandler = useRef(); | |
// Update ref.current value if handler changes. | |
// This allows our effect below to always get latest handler ... | |
// ... without us needing to pass it in effect deps array ... | |
// ... and potentially cause effect to re-run every render. |
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
var z = (function (){ | |
//helpers | |
var cache = {}; | |
var target; | |
var type = {}.toString; | |
var noop = function() {}; | |
var retainer = { subtree : 'retain' }; | |
var treeNode = (function() { | |
treeNode=function(parent,componentName){ | |
this.cName=componentName; |
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
/***************************************** | |
/* DOM touch support module | |
/*****************************************/ | |
(function(document) { | |
var TAPTRESHOLD = 200, // time within a double tap should have happend | |
TAPPRECISION = 60 / 2, // distance to identify a swipe gesture | |
touch = { }, | |
tapCount = 0, // counts the number of touchstart events | |
tapTimer = 0, // timer to detect double tap | |
isTouchSwipe = false, // set to true whenever |
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
// Version: v0.9.8.1-452-gdca2ca4 | |
// Last commit: dca2ca4 (2012-06-27 08:36:22 -0700) | |
(function() { | |
/*global __fail__*/ | |
if ('undefined' === typeof Ember) { | |
Ember = {}; |