Skip to content

Instantly share code, notes, and snippets.

View minajevs's full-sized avatar
⌨️

Dmitrijs Minajevs minajevs

⌨️
View GitHub Profile
http://cosketch.com/Rooms/tuitpmu
https://moqups.com/ -------- MOCKUPS
https://learnxinyminutes.com/docs/ru-ru/javascript-ru/ -------- JAVASCRIPT ЗА ПАРУ ЧАСОВ
PRODUCTIVITY APP
3 views
1 - month view
function PrettyCalendar(e, t, n, r) {
if (typeof n == "undefined") n = false;
if (typeof r == "undefined") {
var i = new Array(7);
i[0] = "Sunday";
i[1] = "Monday";
i[2] = "Tuesday";
i[3] = "Wednesday";
i[4] = "Thursday";
i[5] = "Friday";
[{"id":19821,"updated":19959,"labels":"drum and bass,live","name":"Krust - Intabeats Drum&Bass Show # Ministry of Sound [16.07.2013]","bitrate":"[128 kbps]","mood":null,"date":"2013-07-23","mp3":"http:\/\/mixes.bassblog.pro\/Krust-Intabeats_Drum_and_Bass_Show-2013-07-16.mp3","tracklist":"01 \/\/ Krust - Light Speed Thought\n\n02 \/\/ Need For Mirrors - Sea Slug\n\n03 \/\/ Detail & Tiiu - Days Go By\n\n04 \/\/ Craggz & Parallel - Nobody\n\n05 \/\/ Ed:it - Cargo Dub (Total Science Remix)\n\n06 \/\/ Survival - Hanout\n\n07 \/\/ Kolectiv - Dog Pad (Zero T Remix)\n\n08 \/\/ Break - Steam Train\n\n09 \/\/ Digital - Gee Gees\n\n10 \/\/ Gang Related - J.A.M\n\n11 \/\/ Kid Drama - One 6 Eight\n\n12 \/\/ Skeptical - Eyes Down\n\n13 \/\/ Heist - Step Out The Box\n\n14 \/\/ Krust - Transparency\n\n15 \/\/ Om Unit & Sam Binga - Triffidz\n\n16 \/\/ Krust - Monitor Your Thoughts\n\n17 \/\/ Benjamin One - Oi Stalker (VIP)\n\n18 \/\/ Om Unit & Sam Binga - Squares\n\n19 \/\/ Krust - The Mad Paradise\n\n20 \/\/ Krust - Bi Foot\
function thunk(payload) {
return function (dispatch) {
doSomething(payload)
return dispatch(someAction())
};
}
import {Action, ActionCreator, Dispatch} from 'redux'
import {ThunkAction} from 'redux-thunk'
const thunk: ActionCreator<ThunkAction<Action, IState, void>> = (
payload: string
) => {
return (dispatch: Dispatch<IState>): Action => {
doSomething(payload)
return dispatch(someAction())
}
const thunk = createThunk<State, Action, Payload>((dispatch, payload) => {
doSomething(payload)
return dispatch(someAction())
})
function foo(arg?: number) { ... }
function foo(arg: number | undefined) { ... }
class A {
constructor(); // Error: overload signature not compatible with impl
constructor(a: number | undefined) {}
}
class A {
constructor();
constructor(a?: number) {} // this one works
}
function foo<T>(arg: T) {
if (arg === undefined)
doThis()
else
doThat(arg)
}
// number
foo<number>(42) // OK
foo<number>() // ERROR: 1 argument expected
type OptionalSpread<T> =
T extends undefined
? []
: [T]
function foo<T = undefined>(...args: OptionalSpread<T>){
const arg = args[0] // Type of: T = undefined
if (arg === undefined)
doThis()