Skip to content

Instantly share code, notes, and snippets.

Avatar
👌

Jalal Fathi JaySunSyn

👌
  • Planet Earth | Amsterdam | Vienna | Bali
View GitHub Profile
@JaySunSyn
JaySunSyn / redux-mixin.html
Last active Jan 17, 2018
Redux Polymer Todo Tutorial Step-1
View redux-mixin.html
<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'},
],
@JaySunSyn
JaySunSyn / todo-list.html
Last active Jan 17, 2018
Redux Polymer Todo Tutorial Step-1
View todo-list.html
<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>
View redux-reselect.html
<script src="../../node_modules/reselect/dist/reselect.js"></script>
<script>
(() => {
const getTodos = (state) => {
return state.todo.todos;
};
const todos = Reselect.createSelector([getTodos],
(todos) => {
View redux-actions.html
<script>
(() => {
const add = (todo) => {
return {
type: 'ADD_TODO',
todo: {text: todo},
};
};
const remove = (todo) => {
View redux-reducers.html
<script src="../../node_modules/redux/dist/redux.min.js"></script>
<script>
(() => {
const initialState = {
todos: [
{text: 'Buy Veggies'},
{text: 'Buy Fruits'},
{text: 'Buy Pizza'},
],
View redux-mixin.html
<link rel="import" href="../../bower_components/polymer/polymer-element.html">
<link rel="import" href="../../bower_components/polymer-redux/polymer-redux.html">
<link rel="import" href="redux-reducers.html">
<link rel="import" href="redux-selectors.html">
<link rel="import" href="redux-actions.html">
<script>
(() => {
App = window.App || {};
View todo-list.html
<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>
View redux-middleware.html
<script src="../../node_modules/redux-thunk/dist/redux-thunk.min.js"></script>
<script>
(() => {
const callAPIMiddleware = ({dispatch, getState}) => {
return next => action => {
const {
types,
callAPI,
shouldCallAPI = () => true,
View keybase.md

Keybase proof

I hereby claim:

  • I am jaysunsyn on github.
  • I am jalalio (https://keybase.io/jalalio) on keybase.
  • I have a public key ASB0vIi6qhwg3Phy1DgDxiG4pyI0Shu47agbmiD2WZxjowo

To claim this, I am signing this object:

@JaySunSyn
JaySunSyn / medium-null-example-two.js
Last active Oct 14, 2019
medium-null-example-two
View medium-null-example-two.js
_valueChanged(value) {
if (value) {
this.postUpdate(value);
return;
}
this._errorMessage = 'Please input an amount'
}