Skip to content

Instantly share code, notes, and snippets.

View Jahans3's full-sized avatar
:shipit:

Josh J Jahans3

:shipit:
View GitHub Profile
class MyContainer extends Component {
state = {
itemA: 'something',
itemB: 'another thing'
}
_onPress = () => {
// ...
}
const itemSelector = '[class*="tabs_item"]'
const findParents = ({ initialElement }) => {
let count = 0
let element = initialElement
while (element.parentNode) {
count++
element = element.parentNode
}
export default class BarcodeCaptureView extends Component {
constructor () {
super()
this.state = {
captured: false
}
this._onBarCodeRead = this._onBarCodeRead.bind(this)
this._onCancel = this._onCancel.bind(this)
this.renderScanArea = this.renderScanArea.bind(this)
StatusBar.setBarStyle('light-content')
import * as app from '../../../app';
import defaults from './preloader.json';
/**
* Preloader
*
* @access public
*
* @param {(String|HTMLElement|NodeList)} els
* @param {Object} custom
import * as app from '../../../app';
import defaults from './preloader.json';
/**
* Preloader
*
* @access public
*
* @param {(String|HTMLElement|NodeList)} els
* @param {Object} custom
const f = x => x * 2
const g = x => x + 10
g(f(10)) // 30
const f = x => x * 2
const g = x => x + 10
g(f(f(10))) // 50
const frontPage = async (req, res) => {
try {
const feed = await fetchFeed({ sources })
const response = await sortFeed({ feed })
res(response)
} catch (err) {
console.log(`Error: controllers.feed: ${err}`)
res(Boom.internal(err))
}
}
const SomeOuterComponent = ({ title, children }) => (
<div className="some_outer_class">
<h1>{title}</h1>
{children}
</div>
)
const App = () => (
<SomeOuterComponent title='This is a Title'>
<SomeChildComponent />
</SomeOuterComponent>
)