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 default function injectDependencies({dependencies}) { | |
return({dispatch, getState}) => next => action => | |
typeof action === 'function' ? | |
action({...dependencies, getState}) : | |
next(action); | |
} | |
// action | |
export function fetchOrders(orderId) { | |
return ({fetch}) => ({ |
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 const currentCustomer = ({router, order, customer}) => { | |
const customerId = router.params.customerId; // zależy jak masz w <Route path="/customers/:customerId" /> | |
const currentCustomer = customer.list | |
? customer.list.find(customer => customer._id === customerId) | |
: null; | |
const currentCustomerOrders = order.list | |
? order.list.filter(order => order.user._id === customerId) | |
: null; | |
return { |
This file has been truncated, but you can view the full file.
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
2015-09-21 23:20:17.513 pfc-mobile[3682:148885] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release. | |
Stack:( | |
0 CoreFoundation 0x00000001065f9f65 __exceptionPreprocess + 165 | |
1 libobjc.A.dylib 0x0000000105c10deb objc_exception_throw + 48 | |
2 CoreFoundation 0x00000001065f9e9d +[NSException raise:format:] + 205 | |
3 Foundation 0x00000001059852e5 _AssertAutolayoutOnMainThreadOnly + 79 | |
4 Foundation 0x00000001057e5ece -[NSISEngine withBehaviors:performModifications:] + 31 | |
5 UIKit 0x00000001042c57a6 -[UIView(Hierarchy) layoutBelowIfNeeded] + 510 | |
6 UIKit 0x0000000104757138 -[_UIAlertControllerActionView _updateBackgroundView] + 432 | |
7 UIKit 0x0000000104757f34 -[_UIAlertCon |
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
#!/bin/bash | |
cd web | |
mkdir -p ./node_modules/@este | |
( | |
cd ./node_modules/@este | |
rm -rf ./common | |
ln -s ../../../common ./common |
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
#!/usr/bin/env node | |
// Deps | |
var chain = require('slide').chain; | |
var path = require('path'); | |
var ln = require('linklocal'); | |
var exec = require('./exec'); | |
var program = require('commander'); | |
var linklocal = require('linklocal'); |
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
// will be caught by promise-middleware | |
function makeASandwichWithSecretSauce(name) { | |
return { | |
types: [], | |
payload: fetch(...) | |
} | |
}; | |
// This is complex one | |
// BTW, you don't have redux-thunk |
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 "ActivityView.h" | |
#import "RCTLog.h" | |
#import "RCTBridge.h" | |
#import "RCTUtils.h" | |
#import "RCTUIManager.h" | |
@implementation ActivityViewManager | |
@synthesize bridge = _bridge; |
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 {ActivityViewManager} from 'NativeModules'; | |
ActivityViewManager.share({ | |
text: 'Hey, I have just ordered 10 pizzas from RN app' | |
}); |
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 {ActivityViewManager} from 'NativeModules'; | |
ActivityViewManager.share({ | |
text: 'Hey, I have just ordered 10 pizzas from RN app', | |
exclude: ['airDrop', 'postToFacebook'] | |
}); |
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 onlyUpdateForKeys from 'onlyUpdateForKeys'; | |
const onlyUpdateForProps = (BaseComponent) => { | |
const propKeys = Object.keys(BaseComponent.propTypes || {}); | |
return onlyUpdateForKeys(propKeys, BaseComponent); | |
}; | |
export default onlyUpdateForProps; |