- You're building an issue tracking system
- Build a component which displays the names of assignees
- eg.
<Assignees assignees={['Mike', 'Sepp', 'David']} />
- build a simple ul
- eg.
- WITH more than 3 assigness,
- only display 3 assignees
- display a show more button
- WHEN the show more button was clicked
- display all assignees
- a show less button is displayed instead of a show more button
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 { | |
allOf, | |
assertThat, | |
describe, | |
equalTo, | |
everyItem, | |
greaterThanOrEqualTo, | |
hasProperty, hasSize, | |
lessThanOrEqualTo | |
} from 'hamjest'; |
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> | |
<title>FHS-Modules</title> | |
</head> | |
<body> | |
<a href="/test1">First Link</a> | |
<a href="/test2">Second Link</a> | |
<section id="content"> |
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
let questions = null; | |
async function getQuestion() { | |
questions = await getQuestions() | |
return questions[Math.random() * questions.length - 1] | |
} | |
function answerQuestion(question, answer) { | |
questions.find((currentQuestion) => currentQuestion.question === question.question) | |
// ^^^^^^^ | |
// if answer question is called before getQuestion is called you'll run into |
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
function calculator() { | |
let value = 0 | |
return function (difference) { | |
value += difference | |
console.log(value) | |
} | |
} | |
const calulator1 = calculator() |
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 callbackFetch = (url, callback) => { | |
// .... | |
} | |
const promiseFetch = (url) => { | |
return new Promise((resolve, reject) => { | |
callbackFetch(url, (result) => { | |
if (result.error) { reject(result) } | |
else { resolve(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
import { AnyAction } from 'redux' | |
import { ThunkAction, ThunkDispatch } from 'redux-thunk' | |
import { rootReducer } from '.' | |
import createHTTPInstance from '../utils/create-http-connection' | |
export type ExternalDependencies = { | |
http: ReturnType<typeof createHTTPInstance> | |
} | |
export type AppState = ReturnType<typeof rootReducer> |
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 SignInForm = ({ onSubmit }) => { | |
const [formState, setFormState] = useState({ username: '', password: '' }) | |
const handleChange = (evt) => { | |
setFormState({ ...formState, [evt.target.name]: evt.target.value }) | |
} | |
return ( | |
<form onSubmit={() => onSubmit(formState)}> |
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
// @ts-ignore | |
import {assertThat, equalTo} from 'hamjest'; | |
type CellState = 'alive' | 'dead' | |
type EventType = CellState | 'nextGeneration' | |
type Event<Type> = { | |
state: Type | |
} |
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 React, { useState } from 'react'; | |
const Button = ({ children, variant = 'button' }) => { | |
return ( | |
<button style={{ background: variant === 'button' ? 'blue' : 'green'}}> | |
{ children } | |
</button> | |
) | |
}; |
NewerOlder