This file contains 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
RCT_EXPORT_METHOD( | |
confirmPaymentIntent:(NSString *)payment_intent_client_secret | |
resolvePromise:(RCTPromiseResolveBlock)resolve | |
rejectPromise:(RCTPromiseRejectBlock)reject | |
) | |
{ | |
// Create the payment intent using the payment_intent_client_secret | |
[[STPAPIClient sharedClient] retrievePaymentIntentWithClientSecret:payment_intent_client_secret completion:^(STPPaymentIntent *paymentIntent, NSError *error) { | |
NSLog(@"Intent %@", paymentIntent); |
This file contains 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 { all, call, takeLatest } from "redux-saga/effects"; | |
import { FETCH_USER_ORDERS_REQUEST, FETCH_USER_ORDERS_RESPONSE } from "../types"; | |
import { fetchOrdersRequest } from "../api"; | |
import { AbstractAPISaga } from "../AbstractAPISaga"; | |
export default function* UserOrdersSaga (baseUrl) { | |
yield all([ | |
yield takeLatest(FETCH_USER_ORDERS_REQUEST, | |
action => AbstractAPISaga(action, baseUrl, fetchOrdersRequest, FETCH_USER_ORDERS_RESPONSE) | |
]); |
This file contains 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 { put, call } from "redux-saga"; | |
export function* AbstractAPISaga( | |
action, | |
baseUrl, | |
api, | |
type, | |
) { | |
try { | |
const payload = { ...action.payload }; |
This file contains 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 { all, call, put, takeLatest } from "redux-saga/effects"; | |
import { FETCH_USER_ORDERS_REQUEST, FETCH_USER_ORDERS_RESPONSE } from "../types"; | |
import { fetchOrdersRequest } from "../api"; | |
export function* fetchUserOrders(action, baseUrl) { | |
try { | |
const { filter } = action.payload; | |
const orders = yield call(fetchOrdersRequest, baseUrl, filter); | |
yield put({ |
This file contains 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
... | |
(async () => { | |
await // Do something async | |
})(); | |
... |
This file contains 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 from "react"; | |
import { View, Text } from "react-native"; | |
const Alert = ({ title, text }) => { | |
return ( | |
<ThemeContext.Consumer> | |
{theme => ( | |
<View style={[ | |
..., | |
{ |
This file contains 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 from "react"; | |
import { View, Text } from "react-native"; | |
const Alert = ({ title, text, backgroundColor, borderColor, titleColor, descriptionColor }) => { | |
return ( | |
<ThemeContext.Consumer> | |
{theme => ( | |
<View style={[ | |
..., | |
{ |
This file contains 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 from "react"; | |
import { View, Text } from "react-native"; | |
import palx from "palx" // props to palx! | |
const ThemeContext = React.createContext(palx("#ff0066")); | |
const Alert = ({ title, text }) => { | |
return ( | |
<ThemeContext.Consumer> | |
{theme => ( | |
<View style={[ |
NewerOlder