Essentialy this document is a compilation of articles, tutorials and personal experience on learning React programming and specifically, RxSwift and RxCocoa.
One of the best things of Rx is that you can use the same core concepts on any technology that has an implementation of this paradigm. With this in mind, the first section has general knowledge of this paradigm, so it will be useful for any platform (Java, Swift, JavasCript, even C#).
After that, the content will shift more towards iOS and Swift, with advanced content to get the most of RxSwift and RxCocoa.
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
// | |
// URLSessionHelpers.swift | |
// | |
// Created by Mauricio Cousillas on 6/17/19. | |
// Copyright © 2019 Mauricio Cousillas. All rights reserved. | |
// | |
import Foundation | |
import Combine |
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
// AnalyticsTracker.js | |
import Config from 'react-native-config'; | |
import amplitude from 'amplitude-js'; | |
class AnalyticsService { | |
constructor(apiKey) { | |
amplitude.getInstance().init(apiKey, null, { | |
useNativeDeviceInfo: true, | |
}); | |
} |
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, { useMemo, useRef } from 'react'; | |
import { View } from 'react-native'; | |
import { node } from 'prop-types'; | |
import { PanGestureHandler, State, PinchGestureHandler } from 'react-native-gesture-handler'; | |
import Animated from 'react-native-reanimated'; | |
import styles from './styles'; | |
/** styles.js | |
import { StyleSheet } from 'react-native'; |
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 UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
enum ColorSpace { | |
case rainbow | |
case gray | |
var colors: [CGColor] { |
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 { useCallback, useReducer, Reducer } from 'react'; | |
enum FormActions { | |
UPDATE_BLUR = 'UPDATE_BLUR', | |
UPDATE_ERROR = 'UPDATE_ERROR', | |
UPDATE_VALUE = 'UPDATE_VALUE', | |
OVERRIDE_ERRORS = 'OVERRIDE_ERRORS', | |
OVERRIDE_VALUES = 'OVERRIDE_VALUES', | |
} |
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 { useEffect, useState } from "react"; | |
export const useDebouncedState = <T>(initialValue: T, delay: number) => { | |
const [value, setValue] = useState(initialValue); | |
const [debouncedValue, setDebouncedValue] = useState(initialValue); | |
useEffect(() => { | |
const handler = setTimeout(() => { | |
setDebouncedValue(value); | |
}, delay); |