Skip to content

Instantly share code, notes, and snippets.

View jordangarcia's full-sized avatar

Jordan Garcia jordangarcia

View GitHub Profile
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable compat/compat */
import $ from 'jquery';
import lumin from '../constants/lumin';
const contentType = { 'Content-Type': 'application/json' };
export const ajaxRequest = function (
endpoint = '',
method = 'get',
const promise = new Promise2((resolve, reject) => {
setTimeout(() => {
resolve('hello')
}, 500)
})
promise.then((value) => {
console.log(value)
})

Authentication

Must supply Authorization: Bearer ${token} as a header

Endpoints

GET /user/kv

Returns a mapping of all key values for that user

User Experiment KV API

GET /account/kv

{
  [key]: value
  [key]: value
  [key]: value
  [key]: value

Timer Challenge

Create a timer that counts upwards. Starting at 00:00 and counts up every second.

There should be two buttons when the timer is first rendered

MOCK

00:00

import React, { useEffect, useState } from "react";
import { Flex, Title, Button } from "../../design/components";
import { Link } from "react-router-dom";
export default function Michael(props) {
const [greeting, setGreeting] = useState("initialValue");
useEffect(() => {
alert("greeting changed");
}, [greeting]);
import icons from "./icons";
const breakpoints = ["480px", "900px", "1025px", "1280px"];
// TODO should this be `small` medium and large
breakpoints.sm = breakpoints[0];
breakpoints.med = breakpoints[1];
breakpoints.lg = breakpoints[2];
const colors = {
import icons from "./icons";
const breakpoints = ["480px", "900px", "1025px", "1280px"];
// TODO should this be `small` medium and large
breakpoints.sm = breakpoints[0];
breakpoints.med = breakpoints[1];
breakpoints.lg = breakpoints[2];
const colors = {