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
// Option 1 | |
const result = stepOne(input).stepTwo().stepThree() | |
// Option 2 | |
let result = input | |
result = stepOne(result) | |
result = stepTwo(result) | |
result = stepThree(result) |
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 result = stepOne(input).stepTwo().stepThree() |
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 steps = [ | |
stepOne, | |
stepTwo, | |
stepThree | |
] | |
const result = runSteps(steps) |
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
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
var auth = new Auth(); | |
return MaterialApp( | |
title: 'Pod', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData(primarySwatch: Colors.amber), | |
home: WithAuth(auth: auth, builder: (user) => DummyRootPage())); |
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 fetchWithHeaders(url: string, jwt: ?string = null, params: ParamType = {}) { | |
const customHeaders = params.headers || {} | |
const otherParams = omit(params, 'headers') | |
const headers = { | |
'X-Requested-With': 'XMLHttpRequest', | |
'X-CSRF-Token': window.rippleCSRF, | |
Accept: 'application/json, text/plain, */*', | |
'Content-Type': 'application/json', | |
...customHeaders | |
} |
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
[ | |
{ | |
"uuid": "9d750b19-1319-425c-add6-f091181cf65a", | |
"type": "asteroid", | |
"position": [12.3, 34.2], | |
"radius": 20.3, | |
} | |
] |
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 animate(posX, posY, directionX, directionY, delta) { | |
return { | |
x: posX + (directionX * delta), | |
y: posY + (directionY * delta) | |
} | |
} |
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 animate(pos, direction, delta) { | |
return pos.plus(direction.scaleBy(delta)) | |
} |
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 isValidOrder(order, customer) { | |
return | |
order.units > 1 && | |
order.state == 'complete' && | |
includingSalesTax(order.price) < customer.availableBalance | |
} |
NewerOlder