Skip to content

Instantly share code, notes, and snippets.

View chl03ks's full-sized avatar
🍊
Working from home

Dan Garcia chl03ks

🍊
Working from home
View GitHub Profile
@chl03ks
chl03ks / pull-request-template.md
Created September 26, 2017 21:45 — forked from Lordnibbler/pull-request-template.md
Sample Pull Request Template

Status

READY/IN DEVELOPMENT/HOLD

Migrations

YES | NO

Description

A few sentences describing the overall goals of the pull request's commits.

Related PRs

@chl03ks
chl03ks / buildspec.yml
Created October 11, 2017 19:48 — forked from marcelog/buildspec.yml
Example for buildspec file for Amazon CodeBuild and Amazon CodePipeline to achieve Continuous Integration and Continuous Delivery for a ServerLess project
version: 0.1
phases:
install:
commands:
- printenv
- npm install
build:
commands:
- npm run build
/* State Tree */
{
players: [{
id: 1,
level: 10
},{
id: 2,
level: 20
}]
}
/* Action to be dispatched */
{
type: 'LEVEL_UP',
id: 1,
}
const players = (state = [{ id: 1, level: 10 }], action) => {
if (action.type === 'LEVEL_UP') {
return state.map(player => {
if(player.id !== action.id) return state;
return { ...player, level: player.level + 1 }
})
} else if (action.type === 'LEVEL_DOWN') {
return state.map(player => {
if(player.id !== action.id) return state;
return { ...player, level: player.level - 1 }