Skip to content

Instantly share code, notes, and snippets.

#import "RCTEventDispatcher.h"
#import "RCTRootView.h"
// somewhere in application:didFinishLaunchingWithOptions:(
self.bridge = rootView.bridge;
// sometime later
[self.bridge.eventDispatcher sendAppEventWithName:@"backgroundPositionResponse" body:JSON];
@rt2zz
rt2zz / excerpt.js
Created November 29, 2015 21:19
disable persistStore in node environment
if (typeof self === 'object') persistStore(store)
@rt2zz
rt2zz / index.ios.js
Created November 27, 2015 23:23
competing drawers
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
POST v1/jobs
{
position,
venueId, // string or null
venue, // object or null -> if object create a new venue record and save the resultant venueId to the new job
// ... other job data
}
OR
@rt2zz
rt2zz / PrependableListView.js
Created October 22, 2015 05:42
Prependable List View
/**
* Copyright (c) 2015, Facebook, Inc. All rights reserved.
*
* Facebook, Inc. ("Facebook") owns all right, title and interest, including
* all intellectual property and other proprietary rights, in and to the React
* Native CustomComponents software (the "Software"). Subject to your
* compliance with these terms, you are hereby granted a non-exclusive,
* worldwide, royalty-free copyright license to (1) use and copy the Software;
* and (2) reproduce and distribute the Software as part of your own software
* ("Your Software"). Facebook reserves all rights not expressly granted to
@rt2zz
rt2zz / index.js
Created October 4, 2015 19:40
requirebin sketch
var _ = require('lodash')
var p = _.partial(console.log, 'abc')
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTDefines.h"
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"ios"
initialProperties:nil
launchOptions:launchOptions];
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
{
".source.js":
"Common Actions: require lodash":
prefix: "lodash"
body: "import _ from 'lodash'"
@rt2zz
rt2zz / elmSideEffects.js
Last active August 29, 2015 14:27
Side Effects API's
// side effects are created by reducer, but executed by store
function reducer(state, action, createSideEffect){
if(action.type === 'SUBMIT_DATA'){
createSideEffect(({action, getState, dispatch}) => {
//.. do work
})
}
}