cached-fetch optimizes your app’s data fetching, whatever your app platform is

const fetcher = (...args) => fetch(...args).then(res => res.json());
function App() {
const { data, error } = useSWR('/api/user/123', fetcher); ...
}


Installation

  1. We can build it easily with the react-native command.
$ npx react-native init reactNavigationTutorial —-template react-native-template-typescrip
$ yarn add @react-navigation/native
$ yarn add react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view


Set up the environment

$ brew install node
$ brew install watchman
$ npm install -g typescript

Android


Generator

function* generator() {
console.log('one');
yield 1;

console.log('two');
yield 2;
console.log('three');
yield 3; console.log('four');}const iterable = generator();console.log(iterable);
console.log(iterable.next());
console.log(iterable.next());
console.log(iterable.next());
console.log(iterable.next());
----------------------------- Console -----------------------------Object [Generator] {}
one
{ value: 1, done: false }
two
{ value: 2, done: false }
three
{ value: 3, done: false }
four
{ value: undefined, done: true }

Pipe

test('pipe', () => {  const squareOnlyOdds = pipe(    (collection) => filter(collection, value => value % 2),    (collection) => map(collection, value => value * value),  );  expect(squareOnlyOdds([1, 2, 3, 4, 5, 6])).toStrictEqual([1, 9, 25]);});

1. Reduce


function each(collection, iteratee) {  for (const value of collection) {    iteratee(value);  }}
module.exports = each;

Functional Programming

Before We Start With Function Programming

Function Programming


1. Setup the MySQL database

$ brew install mysql


Photo by Caspar Camille Rubin on Unsplash

1. setup app and make SideMenu component

$ npx create-react-app forward-ref-tutorial --template typescript

Woohyun Jang

woohyun

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store