This file contains 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
const flat = (base, val) => Array.isArray(val) ? base.concat(val.reduce(flat, [])) :base.concat(val); | |
const map = arr => arr.reduce(flat, []); | |
console.log(map([1,23,[3,[3,1,[3,4],5],6],5])) |
This file contains 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
/** | |
Input: [“3”, “1”, “+”, “5”, “*”] | |
Output: 9 | |
Explanation: ((3 + 1) * 5) = 20 | |
*/ | |
function RPN(seq) { | |
if (seq.length <= 2) { | |
console.log('Please enter valid RPN') |
This file contains 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
import React from "react"; | |
import logo from "./logo.svg"; | |
import { WindowOpener } from "./window-opener"; | |
export class Home extends React.Component { | |
constructor (props) { | |
super(props); | |
this.state = { | |
message: "" | |
} |
This file contains 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
import React from "react"; | |
export class Son extends React.Component { | |
constructor (props) { | |
super(props); | |
this.state = { | |
message: "" | |
} | |
this.onChangeHandler = this.onChangeHandler.bind(this); | |
} |
This file contains 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
import PropTypes from "prop-types"; | |
import React from "react"; | |
// Main Window. | |
let browser = null; | |
// child window. | |
let popup = null; | |
// interval | |
let timer = null; | |
// This function is what the name says. |
This file contains 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
import React from 'react'; | |
import { BrowserRouter, Redirect, Route, Switch } from "react-router-dom"; | |
import './App.css'; | |
import { Home } from "./Home"; | |
import { Son } from "./Son"; | |
function App() { | |
return ( | |
<div className="App"> |
This file contains 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
import * as qs from "qs"; | |
import { PathLike } from "fs"; | |
export const apiConfig = { | |
returnRejectedPromiseOnError: true, | |
withCredentials: true, | |
timeout: 30000, | |
baseURL: "https://jsonplaceholder.typicode.com/", | |
headers: { | |
common: { |
This file contains 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
import { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; | |
import { Api } from './../src/api/api'; | |
import { Credentials, Token, User } from './interfaces'; | |
export class UserApi extends Api { | |
public constructor (config?: AxiosRequestConfig) { | |
super(config); | |
// this middleware is been called right before the http request is made. |
This file contains 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
Show hidden characters
{ | |
"compilerOptions": { | |
"incremental": true, | |
"target": "es2019", | |
"module": "esnext", | |
"lib": [ | |
"DOM", | |
"ES2017", | |
"ES2019" | |
], |
This file contains 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
import { applyMiddleware, createStore } from "redux"; | |
import { composeWithDevTools } from "redux-devtools-extension"; | |
import createSagaMiddleware from "redux-saga"; | |
import { rootReducer } from "../reducers"; | |
import { AppState } from "@eneto/api-client"; | |
import { initUserState } from "../../modules/users/user-reducer"; | |
import { initUsersState } from "../../modules/users/users-reducer"; | |
import { initListsState } from "../../modules/lists/lists-reducer"; |
OlderNewer