Skip to content

Instantly share code, notes, and snippets.

View yashikagarg13's full-sized avatar

Yashika Garg yashikagarg13

View GitHub Profile
@yashikagarg13
yashikagarg13 / index.html
Created March 20, 2017 03:44
Todo App - React + Redux - Refactored into Presentational and Container components // source https://jsbin.com/keqexaj
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.js"></script>
@yashikagarg13
yashikagarg13 / index.html
Created March 18, 2017 14:38
TODO App using Redux - source https://jsbin.com/keqexaj
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.js"></script>
@yashikagarg13
yashikagarg13 / index.html
Created March 18, 2017 10:29
combineReducer Definition source https://jsbin.com/keqexaj
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.js"></script>
</head>
@yashikagarg13
yashikagarg13 / index.html
Last active March 18, 2017 10:14
TODO App - Store source https://jsbin.com/keqexaj
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.js"></script>
</head>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
</head>
<body>
@yashikagarg13
yashikagarg13 / index.html
Last active March 18, 2017 06:39
Changing object props without mutating it
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
</head>
<body>
@yashikagarg13
yashikagarg13 / index.html
Last active March 18, 2017 06:05
Updating list without mutating it using slice(), concat() and spread (...)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
</head>
<body>
@yashikagarg13
yashikagarg13 / index.html
Last active March 18, 2017 05:37
JS Bin// source https://jsbin.com/kiqexic = Create Counter App => React + Redux
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.js"></script>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
@yashikagarg13
yashikagarg13 / usingArraySort
Created March 5, 2017 13:48
Sort array of objects by key
var arrOfObjects = [
{name: "Yashika", age: 27},
{name: "Ketan", age: 28},
{name: "Rahul", age: 13},
{name: "Shivani", age: 20},
{name: "Ankit", age: 45},
{name: "Rashmi", age: 16},
{name: "Vijay", age: 70},
];
@yashikagarg13
yashikagarg13 / flatten-array.js
Created February 28, 2017 16:49
Flatten Arrays
function flatten(arr) {
return arr.reduce(function (acc, item) {
if (item instanceof Array) {
return acc.concat(flatten(item))
} else {
return acc.concat(item)
}
}, []);
}