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
extend({foo:123},b()); | |
function b(){ | |
return [ | |
{foo:123}, | |
{bar:456} | |
]; | |
} |
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
extend({foo:123},b()); | |
function b(){ | |
return extend( | |
{foo:123}, | |
{bar:456} | |
); | |
} |
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
export function extend(...args: any[]):any { | |
let extractFields = obj => { | |
for (let key in obj) { | |
//copy all the fields | |
newObj[key] = obj[key]; | |
} | |
} | |
var extendRecursive = (x:any[]) => { | |
for (let obj of x) { |
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
function test({ x, y }: { x: number, y: number }) { | |
console.log(x, y); | |
} | |
test({ | |
x: 1, | |
y: 2 | |
}); |
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
function test({ x:xLocal, y:yLocal }) { | |
console.log(xLocal, yLocal); | |
} |
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 foo = 123; | |
const bar = { | |
bas : 123, // Why not `bas = 123` | |
}; |
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
function test({ x = 123, y = 456 }: { x?: number, y?: number } = {}) { | |
console.log(x, y); | |
} | |
test({ | |
x: 1, | |
y: 2 | |
}); |
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
/** | |
* Lays out a job with a job form in a scrollable region | |
* with the footer pinned to the bottom | |
*/ | |
@ui.Radium | |
export class LayoutJob extends React.Component<{ | |
content:JSX.Element, | |
footer:JSX.Element, | |
},{}>{ | |
private styles = { |
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
export function padding(a: any, b?: any, c?: any, d?: any) { | |
if (!b && !c && !d) { | |
b = c = d = a; | |
} | |
else if (!c && !d) { | |
c = a; | |
d = b; | |
} | |
return { | |
paddingTop: _toString(a), |
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
type PaddingUnit = number | string; | |
export function padding(a: PaddingUnit, b?: PaddingUnit, c?: PaddingUnit, d?: PaddingUnit) { | |
if (!b && !c && !d) { | |
b = c = d = a; | |
} | |
else if (!c && !d) { | |
c = a; | |
d = b; | |
} | |
return { |