This file contains hidden or 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 Myselector = $; | |
| function wait() { | |
| return new Promise((res, _) => { | |
| setTimeout(() => res(), 5000); | |
| }); | |
| } | |
| function getElements() { | |
| const button = Myselector('span.fr66n button.wpO6b'); | |
| const color = Myselector('span.fr66n .wpO6b svg').getAttribute('fill'); |
This file contains hidden or 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 { useFirestoreConnect } from 'react-redux-firebase'; | |
| import { Table } from 'antd'; | |
| import { useSelector } from 'react-redux'; | |
| const columns = [ | |
| { | |
| title: 'Name', | |
| dataIndex: 'clientName', | |
| width: '25%', | |
| }, |
This file contains hidden or 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
| { | |
| "parser": "@typescript-eslint/parser", | |
| "parserOptions": { | |
| "project": "./tsconfig.json", | |
| "tsconfigRootDir": "." | |
| }, | |
| "env": { | |
| "browser": true, | |
| "jest/globals": true | |
| }, |
This file contains hidden or 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 flatten = param => { | |
| // check if param exist | |
| if (param) { | |
| //check if param is an array | |
| if (Array.isArray(param)) { | |
| /** | |
| * acc: Accumulator with empty array as initial value | |
| * currentValue: is the current value of the iteration | |
| */ | |
| // set initial value to [] |
This file contains hidden or 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
| // @flow | |
| /* eslint-disable no-unused-vars,no-redeclare,flowtype/no-weak-types */ | |
| // type $ExtractReturnType<R, F: (...any[]) => R> = R; | |
| // type $ReturnType<F> = $ExtractReturnType<*, F>; | |
| type $ReturnType<F> = $Call<<Args, R>((...Args) => R) => R, F>; | |
| export type $ActionType<ActionCreator> = $ReturnType<ActionCreator>; | |
| // TODO remove this when flow infer well |
This file contains hidden or 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
| // @flow | |
| import * as React from 'react'; | |
| import { StyleSheet } from 'react-native'; | |
| import { Input, Item, Label } from 'native-base'; | |
| /** | |
| * Style | |
| */ | |
| const Style = StyleSheet.create({ |
This file contains hidden or 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
| // @flow | |
| /* eslint-disable flowtype/no-weak-types */ | |
| import { type Fetch, type Request, type Response } from '../fetch'; | |
| export type JSONValue = any; | |
| export type JSONRequest = {| | |
| cache?: $PropertyType<Request, 'cache'>, | |
| credentials?: $PropertyType<Request, 'credentials'>, | |
| data: JSONValue, |
This file contains hidden or 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
| // @flow | |
| /* eslint-disable flowtype/no-weak-types */ | |
| /** | |
| * Types | |
| */ | |
| type AsyncFunction<Param, Return> = (param: Param) => Promise<Return>; | |
| type CacheType = 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached'; | |
| type CredentialsType = 'omit' | 'same-origin' | 'include'; | |
| type ModeType = 'cors' | 'no-cors' | 'same-origin'; |
This file contains hidden or 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 { useState, useEffect } from "react"; | |
| import * as API from "../api"; | |
| export const useUserInfo = userId => { | |
| const [user, setUser] = useState(false); | |
| useEffect(() => { | |
| const response = API.userInfo(userId); | |
| setUser(response); | |
| }); | |
| return user; | |
| }; |
NewerOlder