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
<script> | |
(() => { | |
const add = (todo) => { | |
return { | |
type: 'ADD_TODO', | |
todo: {text: todo}, | |
}; | |
}; | |
const remove = (todo) => { |
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
<script src="../../node_modules/reselect/dist/reselect.js"></script> | |
<script> | |
(() => { | |
const getTodos = (state) => { | |
return state.todo.todos; | |
}; | |
const todos = Reselect.createSelector([getTodos], | |
(todos) => { |
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
<link rel="import" href="../bower_components/polymer/polymer-element.html"> | |
<link rel="import" href="../bower_components/polymer/lib/elements/dom-repeat.html"> | |
<link rel="import" href="redux/redux-mixin.html"> | |
<dom-module id="todo-list"> | |
<template> | |
<ul> | |
<template is="dom-repeat" items="[[todos]]" as="todo"> | |
<li on-click="_remove">[[todo.text]] <span style="color: white">Remove</span></li> |
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
<link rel="import" href="../../bower_components/polymer/polymer-element.html"> | |
<link rel="import" href="../../bower_components/polymer-redux/polymer-redux.html"> | |
<script> | |
const initialState = { | |
todos: [ | |
{text: 'Buy Veggies'}, | |
{text: 'Buy Fruits'}, | |
{text: 'Buy Pizza'}, | |
], |
NewerOlder