Git Product home page Git Product logo

redux-twitter's Introduction

Redux-Twitter

Basic Twitter Implementation with ReSwift and RxSwift

Build

To build:

  1. Create an OAuth Twitter application from https://apps.twitter.com
  2. Open TwitterCredentials.swift and enter the Consumer Key and the Consumer Secret of your Twitter application:
//  TwitterCredentials.swift
import Foundation
let twitterConsumerKey: String = ""
let twitterConsumerSecret: String = ""

  1. Set the Twitter URL scheme of your Twitter application like twitterkit-<your-consumer-key> in info.plist

  2. Run following commands.

    $ pod install
    
  3. Open Redux-Twitter.xcworkspace in Xcode.

Dependencies

Requirements

  • iOS 9.0+
  • Swift 4.0+

redux-twitter's People

Contributors

goktug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

redux-twitter's Issues

Always showing the same post items

Hello,

I don't know where I am doing wrong at. The problem is that there is a timeline, showing all posts from users a user following, and a profile view, which needs to show only the current user's post. But it also shows the posts of the following users.

Should I make a separate reducer as well as action and state? The following is my current reducer.

enum PostsReducer {
    static var reducer: Reducer<PostsState> {
        return { action, state in
 
            guard let action = action as? PostsAction else {
                return state ?? PostsState()
            }
            var newState = state
            
            switch action {
            case let .updatePosts(userID, posts):
                newState?.userPosts[userID] = posts
                return newState!
            case let .updateListener(userID, listener):
                newState?.postsListeners?[userID] = listener
                return newState!
            case let .updateUserPosts(posts):
                newState?.posts = posts
                return newState!
            case let .updateUserListener(listener):
                newState?.userPostsListener = listener
                return newState!
            }
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.