This file contains hidden or 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
// ACTIONCREATORS USAGE EXAMPLE 1 | |
// When the action needed are all in a single duck (in this case authReducer) | |
import React, { Component, PropTypes } from 'react' | |
import { connect } from 'react-redux' | |
import { bindActionCreators } from 'redux' | |
import { actionCreators } from '../reducers/authReducer' | |
const mapStateToProps = (state, ownProps) => ({ | |
// blablabla | |
}) |
This file contains hidden or 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* signup (action) { | |
const { email, password } = action | |
try { | |
const user = yield call(parseService.signup, email, password) | |
yield put({ type: authActionTypes.SIGNUP_SUCCESS, user }) | |
yield call(loginSuccess, user) | |
} catch (err) { | |
const error = err.message || err | |
yield put({ type: authActionTypes.SIGNUP_FAILURE, error }) | |
} |
This file contains hidden or 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
import mobx from 'mobx' | |
const DEFAULT_STYLE = 'color: #006d92; font-weight:bold;' | |
// Just call this function after MobX initialization | |
// As argument you can pass an object with: | |
// - collapsed: true -> shows the log collapsed | |
// - style -> the style applied to the action description | |
export const startLogging = ({ collapsed, style } = {}) => { | |
mobx.spy(event => { |
This file contains hidden or 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
import React, { Component, PropTypes } from 'react' | |
import { Dimensions, Modal, StyleSheet } from 'react-native' | |
import { View } from 'react-native-animatable' | |
const DEVICE_WIDTH = Dimensions.get('window').width | |
const DEVICE_HEIGHT = Dimensions.get('window').height | |
const DEFAULT_COLOR = '#001a33' | |
export default class CustomModal extends Component { | |
static propTypes = { |
This file contains hidden or 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
# iOS | |
app_identifier "com.myapp.app" # The bundle identifier of your app | |
apple_id "[email protected]" # Your Apple email address | |
team_id "1234ABCD" # Developer Portal Team ID | |
# Android | |
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one | |
package_name "com.myapp.app" # Your Android app package |
This file contains hidden or 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
// Redux navigations tore | |
{ | |
key: '1', | |
index: 0, | |
children: [{ key: 'museumList', title: 'I musei' }], | |
isDrawerOpen: false | |
} | |
// Navigation structure |
This file contains hidden or 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
import createLogger from 'redux-logger' | |
// Seamless-Immutable logger cleanup | |
const stateTransformer = (state) => { | |
if (typeof state === 'object' && state !== null && Object.keys(state).length) { | |
let newState = {} | |
for (var i of Object.keys(state)) { | |
if (state[i].asMutable) newState[i] = state[i].asMutable({ deep: true }) | |
else newState[i] = state[i] | |
} |
This file contains hidden or 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
a |