https://ant.design/components/auto-complete/
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":1,"keyboard":{"keys":[{"id":0,"legend":"~\n`","state":{"x":0,"y":0,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0},"row":0,"col":0,"keycodes":[{"id":"KC_GRV","fields":[]},{"id":"KC_PWR","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":1,"legend":"!\n1","state":{"x":1,"y":0,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0},"row":0,"col":1,"keycodes":[{"id":"KC_1","fields":[]},{"id":"KC_F1","fields":[]},{"id":"M()","fields":[1]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id": |
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
function addToQueue(...people) { | |
var positions = [] | |
for (var i = 0; i < people.length; i++) { | |
positions[i] = function() { | |
return i + 1 | |
} | |
} | |
return positions |
TodoMVC (http://todomvc.com/) is a common problem that many developers solve when learning a new language. We'll be tackling TodoMVC in pseudocode for tonight's homework.
Create a Todo app in pseudocode.
A user should be able to:
- Add a todo
- Edit a todo
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
* Write pseudocode for a program that allows uses to change a light colour. | |
* The light has three different coloured buttons - red, blue and yellow. | |
* When a user touches a button, the light changes to that colour. | |
* In the selected colour is touched again, make sure the light turns off! | |
* If we go overtime, complete the task for homework. |
We will be using the GitHub service to share some of our code. We will learn
about the underlying technology of GitHub known as git
in the next lesson.
-
Create an account at http://github.com
-
In a Terminal on your computer, run the following two commands:
git config --global user.name "YOUR NAME"
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
export function combineReducers(reducers) { | |
return (oldState, action) => { | |
return Object.keys(reducers).reduce((newState, key) => { | |
const reducer = reducers[key]; | |
newState[key] = reducer(oldState[key], action); | |
return newState; | |
}, {}); | |
}; |
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
describe('combineReducers', () => { | |
it('should combine multiple reducers to a single reducer', () => { | |
const notes = (state = [ 'hello world' ], action) => { | |
switch(action.type) { | |
case 'ADD_NOTE': | |
return [ ...state, action.payload ]; | |
default: | |
return state; | |
} | |
}; |
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
export function createStore(reducer, initialState) { | |
let listeners = []; | |
let currentState = initialState; | |
function getState() { | |
return currentState; | |
} | |
function subscribe(listener) { | |
listeners.push(listener); |
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
describe('#subscribe', () => { | |
it('should add the passed function to the listeners', () => { | |
const store = createStore(x => x, {}); | |
let called = false; | |
store.subscribe(() => called = true); | |
store.dispatch({ type: '' }); | |
expect(called).to.be.true; |
NewerOlder