Skip to content

Instantly share code, notes, and snippets.

View shiftyp's full-sized avatar

Ryan Kahn shiftyp

View GitHub Profile
@shiftyp
shiftyp / womp-womp.ts
Last active December 8, 2020 01:02
Unfortunate TypeScript error
interface RefHandles {
scrollToIntent: HTMLElement['scrollTo'];
}
const targetElement = document.createElement('div');
const handles: RefHandles = {
scrollToIntent(...args: any[]) {
targetElement.scrollTo(...args);
}
import { useInstance } from 'object-hooks';
class Analytics {
private api = () => {
const raceError = new Error('handler called before loaded');
bugsnagClient.notify(raceError);
};
public log = (...args: any[]) => {
return this.api(...args);
@shiftyp
shiftyp / gist:25e05496bbe48df39c57c8fe9a9e3552
Created July 12, 2016 16:00 — forked from lotusgraham/gist:63c9c27234aac0d6474af81ff517b221
Hey, I'm trying to access my state in the handle toggle event. Right now, on line 10, 'tilesData' is only set to run this toggle of expanding/collapsing the card on position 0 of the array...
export default class Cardz extends React.Component {
constructor(props) {
super(props);
this.state = {
tilesData: [
{
img: 'http://loremflickr.com/640/400/breakfast/all',
title: 'Breakfast',