Skip to content

Commit

Permalink
🌎 update repl links for cohort 5 (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
Purvi Kanal authored Sep 4, 2018
1 parent 904c981 commit 90bb8e7
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 144 deletions.
57 changes: 57 additions & 0 deletions src/links/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
export const PARAMETERS = {
invite: "https://repl.it/classroom/invite/XvipfNO",
exercise1:
"https://repl.it/student_embed/assignment/1492285/0339cc5f2176593cbe1e6a6b6cf40cb2"
};

export const RETURN = {
invite: "https://repl.it/classroom/invite/Xvb4pIt",
exercise1:
"https://repl.it/student_embed/assignment/1492272/e1e304a8fbe1dad1eefaddbe897bdae6",
exercise2:
"https://repl.it/student_embed/assignment/1492271/4257dd0bdc509b2cc123249c1ff02526"
};

export const ARROW_FUNCTIONS = {
invite: "https://repl.it/classroom/invite/XvedktC",
exercise1:
"https://repl.it/student_embed/assignment/1492279/4905683f6a600f95f4b74d3003cec53a"
};

export const CALLBACKS = {
invite: "https://repl.it/classroom/invite/XvhmgdL",
exercise1:
"https://repl.it/student_embed/assignment/1492283/5586c54efd8e2124d7a123f30e8b20f8"
};

export const PURE_FUNCTIONS = {
invite: "https://repl.it/classroom/invite/XvdamSz",
exercise1:
"https://repl.it/student_embed/assignment/1492278/37a21c5b28239a43b266961c089ed44d"
};

export const FILTER = {
invite: "https://repl.it/classroom/invite/XvJM11a",
exercise1:
"https://repl.it/student_embed/assignment/1490944/600947e6a9cee06b8ed387e0b7cecd0c",
exercise2:
"https://repl.it/student_embed/assignment/1490943/7cf916312a71aab62f56a16b78903406"
};

export const MAP = {
invite: "https://repl.it/classroom/invite/XvIJ2r7",
exercise1:
"https://repl.it/student_embed/assignment/1490942/91e0113f0ac30c223dfa0f58280ece73",
exercise2:
"https://repl.it/student_embed/assignment/1490941/0cd4dd9dc924589b1814a3d307e654d8"
};

export const REDUCE = {
invite: "https://repl.it/classroom/invite/Xvc7niw",
exercise1:
"https://repl.it/student_embed/assignment/1492273/492ac8a84f624191efd3c043e955ff92",
exercise2:
"https://repl.it/student_embed/assignment/1492277/6369db51be4ea2fd4243a68a1a51a1dd",
exercise3:
"https://repl.it/student_embed/assignment/1492276/ee34964c023ce10ef6d37129343a0e7d"
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,22 @@ import {
ReplFrameSlide
} from "../../tools";

const Slide1 = ListSlideMaker(
"Parameters",
["0 or many items that are passed into a function for its use",
import { PARAMETERS } from "../../links";

const Slide1 = ListSlideMaker("Parameters", [
"0 or many items that are passed into a function for its use",
"A function defines the parameters it expects",
"The order of the parameters passed in should match the order expected by the function"]
);
"The order of the parameters passed in should match the order expected by the function"
]);

const Slide2 = ListSlideMaker(
"Parameters",
["In ES6, you can assign default parameter values to be used when an argument is not passed in",
const Slide2 = ListSlideMaker("Parameters", [
"In ES6, you can assign default parameter values to be used when an argument is not passed in",
"You can also use the rest operator to group the parameters together as an array",
"It's important to name your parameters well to help with readability"]
);
"It's important to name your parameters well to help with readability"
]);

const Slide3 = ReplClassSignup(
"Parameters",
"https://repl.it/classroom/invite/U53uwpg"
);
const Slide4 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/984641/b612cfbf9148ec128d6929f5fe21cfca"
);
const Slide3 = ReplClassSignup("Parameters", PARAMETERS.invite);
const Slide4 = ReplFrameSlide(PARAMETERS.exercise1);

export const FAnatomyParameterSlideSet = [
Slide1,
Expand Down
24 changes: 9 additions & 15 deletions src/slides/function-anatomy-return/function-anatomy-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@ import {
ReplClassSignup,
ReplFrameSlide
} from "../../tools";
import { RETURN } from "../../links";

const Slide1 = ListSlideMaker(
"Returns",
["A return statement is something you should have in almost all of your functions",
const Slide1 = ListSlideMaker("Returns", [
"A return statement is something you should have in almost all of your functions",
"Without a return, a function resolves to 'undefined'",
"You can be very creative about what is returned - for example, you can return another function",
"The result of a function return can be used immediately after that function has finished its business"]
);
"The result of a function return can be used immediately after that function has finished its business"
]);

const Slide2 = ReplClassSignup("Returns", RETURN.invite);
const Slide3 = ReplFrameSlide(RETURN.exercise1);
const Slide4 = ReplFrameSlide(RETURN.exercise2);

const Slide2 = ReplClassSignup(
"Returns",
"https://repl.it/classroom/invite/UeLeKQb"
);
const Slide3 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/994891/d75eb0695d276c4e4316014626b380cd"
);
const Slide4 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/994774/56685ccab70b740d0cae8b5d22adc1c5"
);
export const FAnatomyReturnSlideSet = [
Slide1,
BasicCodeSlideMaker(returnCode),
Expand Down
19 changes: 7 additions & 12 deletions src/slides/function-arrow/function-arrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,17 @@ import {
ReplClassSignup,
ReplFrameSlide
} from "../../tools";
import { ARROW_FUNCTIONS } from "../../links";

const Slide1 = ListSlideMaker(
"Arrow Function",
["A shorthand for a regular function",
const Slide1 = ListSlideMaker("Arrow Function", [
"A shorthand for a regular function",
"Must be defined on a variable - can't use the 'function' keyword",
"Can be written in a way to return a value by default and without using the 'return' keyword",
"Can be written as a single line!"]
);
"Can be written as a single line!"
]);

const Slide2 = ReplClassSignup(
"Arrow Function",
"https://repl.it/classroom/invite/U58GrJ"
);
const Slide3 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/994892/2990a9577dc2df49e19e6c36d40ff428"
);
const Slide2 = ReplClassSignup("Arrow Function", ARROW_FUNCTIONS.invite);
const Slide3 = ReplFrameSlide(ARROW_FUNCTIONS.exercise1);

export const ArrowSlideSet = [
Slide1,
Expand Down
28 changes: 11 additions & 17 deletions src/slides/function-callback/function-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,25 @@ import {
ReplClassSignup,
ReplFrameSlide
} from "../../tools";
import { CALLBACKS } from "../../links";

const Slide1 = ListSlideMaker(
"Function Callback",
["Functions can be assigned to variables",
"Functions that are assigned to variables can be invoked like you would expect"]
);
const Slide1 = ListSlideMaker("Function Callback", [
"Functions can be assigned to variables",
"Functions that are assigned to variables can be invoked like you would expect"
]);

const Slide2 = BasicCodeSlideMaker(pureCode);

const Slide3 = ListSlideMaker(
"Function Callback",
["If we can assign a function to a variable, this means we can assign a function as an argument",
"Parameters that are functions are often referred to as callbacks"]
);
const Slide3 = ListSlideMaker("Function Callback", [
"If we can assign a function to a variable, this means we can assign a function as an argument",
"Parameters that are functions are often referred to as callbacks"
]);

const Slide4 = BasicCodeSlideMaker(pureCode2);

const Slide5 = ReplClassSignup(
"Function Callback",
"https://repl.it/classroom/invite/U57Ds9p"
);
const Slide5 = ReplClassSignup("Function Callback", CALLBACKS.invite);

const Slide6 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/984647/65e52fcb62b3c7f4bd1e7671b32069a0"
);
const Slide6 = ReplFrameSlide(CALLBACKS.exercise1);

export const FCallbackSlideset = [
Slide1,
Expand Down
30 changes: 15 additions & 15 deletions src/slides/function-pure/function-anatomy-pure.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ import {
ReplClassSignup,
ReplFrameSlide
} from "../../tools";
import { PURE_FUNCTIONS } from "../../links";

const Slide1 = ListSlideMaker(
"Pure Function",
["Minimalistic and explicit - you want these to be small and very clear",
"No side effects! Don't access or change something that exists outside the function; only use or modify values that are passed into or defined inside the function",
"Should have a return statement - think of a pure function like a small factory: you give it the supplies and it outputs the product. The most important part is that the same supplies should always give you the same end product"],
["A side effect is when a function changes something outside of its local function scope.",
"Why it's a problem: if you mutated a variable outside of the function scope, and that variable is read by another function at some other point in time = potential concurrency bug.",
"A side effect giveaway: no return statement. If it makes sense to call it without a return value it’s likely impure.",
"The function return should be predictable: same inputs results in same outputs, 'idempotent'. Is a function that gets the current date idempotent?",
"These properties make pure functions reliable building blocks, and prefered."]
[
"Minimalistic and explicit - you want these to be small and very clear",
"No side effects! Don't access or change something that exists outside the function; only use or modify values that are passed into or defined inside the function",
"Should have a return statement - think of a pure function like a small factory: you give it the supplies and it outputs the product. The most important part is that the same supplies should always give you the same end product"
],
[
"A side effect is when a function changes something outside of its local function scope.",
"Why it's a problem: if you mutated a variable outside of the function scope, and that variable is read by another function at some other point in time = potential concurrency bug.",
"A side effect giveaway: no return statement. If it makes sense to call it without a return value it’s likely impure.",
"The function return should be predictable: same inputs results in same outputs, 'idempotent'. Is a function that gets the current date idempotent?",
"These properties make pure functions reliable building blocks, and prefered."
]
);

const Slide2 = ReplClassSignup(
"Pure Function",
"https://repl.it/classroom/invite/U59Jpjv"
);
const Slide2 = ReplClassSignup("Pure Function", PURE_FUNCTIONS.invite);

const Slide3 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/984648/07a60b50ab2b579174bff1011fa952af"
);
const Slide3 = ReplFrameSlide(PURE_FUNCTIONS.exercise1);

export const FAnatomyPureSlideSet = [
Slide1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,26 @@ import {
ReplClassSignup,
ReplFrameSlide
} from "../../tools";
import { FILTER } from "../../links";

const Slide1 = ListSlideMaker(
"Array Filter",
["Iterates through a list of items in an array and applies a provided function to each item to determine whether to put the result into the new array",
const Slide1 = ListSlideMaker("Array Filter", [
"Iterates through a list of items in an array and applies a provided function to each item to determine whether to put the result into the new array",
"The .filter() method can be called on any array",
"The .filter() method expects a function 'callback'",
"This function is fired for each item in the array - if there are three items, the function will run three times",
"Each time the function is run, it is passed the current array item as the first parameter"]
);
"Each time the function is run, it is passed the current array item as the first parameter"
]);

const Slide2 = ListSlideMaker(
"Array Filter",
["The callback function should return a 'truthy' or 'falsy' value",
const Slide2 = ListSlideMaker("Array Filter", [
"The callback function should return a 'truthy' or 'falsy' value",
"If the function returns a truthy value, the current item will be added to the result array. If not, it will be ignored.",
"Filter will always return a new array that is the same length or shorter than the original",
"The original list will -not- be changed or mutated"]
);
"The original list will -not- be changed or mutated"
]);

const Slide4 = ReplClassSignup(
"Array Filter",
"https://repl.it/classroom/invite/UfIUspT"
);
const Slide5 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/997023/5c42df2c82f4a8d9922c36b9a92f2383"
);
const Slide6 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/997024/d4a5a2556ea9fbc4cf4aeff970f24fea"
);
const Slide4 = ReplClassSignup("Array Filter", FILTER.invite);
const Slide5 = ReplFrameSlide(FILTER.exercise1);
const Slide6 = ReplFrameSlide(FILTER.exercise2);

export const FPFilterSlideSet = [
Slide1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,24 @@ import {
ReplClassSignup,
ReplFrameSlide
} from "../../tools";
import { MAP } from "../../links";

const Slide1 = ListSlideMaker(
"Array Map",
["Iterates through a list of items in an array and applies a provided function to each item before putting the result into a new array",
const Slide1 = ListSlideMaker("Array Map", [
"Iterates through a list of items in an array and applies a provided function to each item before putting the result into a new array",
"The .map() method expects a function 'callback'",
"This function is fired for each item in the array - if there are three items, the function will run three times",
"Each time the function is run, it is passed the current array item as the first parameter"]
);
"Each time the function is run, it is passed the current array item as the first parameter"
]);

const Slide2 = ListSlideMaker(
"Array Map",
["The result of the callback function will be added to the new array at the same index as the input from the original",
const Slide2 = ListSlideMaker("Array Map", [
"The result of the callback function will be added to the new array at the same index as the input from the original",
"Map will always return a new array that is the same length of the original",
"The original list will -not- be changed or mutated"]
);
"The original list will -not- be changed or mutated"
]);

const Slide3 = ReplClassSignup(
"Array Map",
"https://repl.it/classroom/invite/UfJXrZW"
);
const Slide4 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/997068/7542de722e6e8190419a5dd009540b01"
);
const Slide5 = ReplFrameSlide(
"https://repl.it/student_embed/assignment/997070/8d1fa5a839000aa36e665e77fe051b05"
);
const Slide3 = ReplClassSignup("Array Map", MAP.invite);
const Slide4 = ReplFrameSlide(MAP.exercise1);
const Slide5 = ReplFrameSlide(MAP.exercise2);

export const FPMapSlideSet = [
Slide1,
Expand Down
Loading

0 comments on commit 90bb8e7

Please sign in to comment.