Skip to content

Instantly share code, notes, and snippets.

View objectliteral's full-sized avatar

Peter Steinberg objectliteral

View GitHub Profile
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
</View>
);

Ok, quick blog/rant here:

As someone who generally avoids using classes in JavaScript, this was completely new to me: The equality of class methods behaves inconsistently, like in the following examples.

What we would do in the old days of JavaScript to emulate class-like semantics, was to have a "constructor"-function create and return an object, thereby more or less instantiating this "class". This just uses the basic building blocks of JavaScript: Functions and Objects (not even inheritance). And it was fine.

var F = function () {
  return {
 foo: function () {
@objectliteral
objectliteral / gulpfile.js
Created February 12, 2017 23:26
gulp analyzes the function signature of the task?
gulp.task('one', function (callback) {
console.log('one');
});
gulp.task('two', [ 'one'], function () {
console.log('two');
});
// `gulp two` for the above logs "one"
// but for the following, it logs "one" "two"

Keybase proof

I hereby claim:

  • I am objectliteral on github.
  • I am objectliteral (https://keybase.io/objectliteral) on keybase.
  • I have a public key whose fingerprint is 3E8D CE8D A45F BFBB AFA7 F109 4AD7 FC2C C241 DB85

To claim this, I am signing this object: