Giter Site home page Giter Site logo

reactor's People

Contributors

vmanot avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

reactor's Issues

Call to main actor-isolated instance method 'trigger' in a synchronous nonisolated context

Getting compiler error on the following file: ReactorActionTask.swift
Error: Call to main actor-isolated instance method 'trigger' in a synchronous nonisolated context

public final class ReactorActionTask<R: Reactor>: PassthroughTask<Void, Error>, ExpressibleByNilLiteral {
    var reactor: R?
    var action: R.Action?
    
    public required convenience init(nilLiteral: ()) {
        self.init(action: { })
    }
}

extension ReactorActionTask {
    public class func failure(_ error: Error) -> Self {
        .init { attemptToFulfill in
            attemptToFulfill(.failure(error))
        }
    }
    
    public class func error(description: String) -> Self {
        .init { attemptToFulfill in
            attemptToFulfill(.failure(CustomStringError(description: description)))
        }
    }
    
    public static func trigger<Coordinator: ViewCoordinator>(
        _ route: Coordinator.Route,
        in router: Coordinator
    ) -> Self {
        .action {
            router.trigger(route) // Here <----
        }
    }
}

Returning wrong status

status(of: Action) is returning active when the action fails instead of error. mapError is being called as well.

Error related to eraseToActionTask

Getting the following error: Type of expression is ambiguous without more context
Is it happening due to 3 definitions for eraseToActionTask?

func task(for action: Action) -> ActionTask {
      switch action {
          case .startPocketMoneyFlow:
              return repository
                  .getPocketMoneySub()
                  .receiveOnMainQueue()
                  .map { $0.results?.first }
                  .publish(to: \.pocketMoneySub, on: authenticatedContext)
                  .then { 
                      self.isPocket = false
                  }
                  .mapError{ (error) -> Error in
                      return error
                  }
                  .eraseToActionTask() // <- Here

In @ReactorRepository() repository :

    public func getPocketMoneySub() -> AnyPublisher<PaginatedL<User.PocketSubscription>, Error> {
        serverSession
            .task(with: .getPocketSub)
            .successPublisher
            .tryMap({ try $0.unwrap(ServerResponse.getPocketSub) })
            .eraseToAnyPublisher()
    }

Crashing

Crashing on presentOnTop

ViewReactor+DynamicViewPresenter.swift

    public func present(_ item: AnyModalPresentation, completion: @escaping () -> Void) {
        guard let presenter = environment.environment.presenter else {
            return assertionFailure() _// crashes here_
        }
        
        var item = item
        
        item.content.mergeEnvironmentBuilderInPlace(coordinator.environmentBuilder)
        
        presenter.present(item, completion: completion)
    }

Logs
Reactor/ViewReactor+DynamicViewPresenter.swift:33: Fatal error
Reactor/ViewReactor+DynamicViewPresenter.swift:33: Fatal error
Screenshot 2021-07-13 at 10 59 06 PM

Need more examples!

I like the library you created, like SwiftUIX Merge.

If it is a library similar to RxSwift's ReactorKit, I would like to make good use of this library, and I would like to have a document for that.

And I tried implementing it with the code in the readme of the current master branch, but it doesn't seem to work.

Thanks for always providing a good library! ๐Ÿฅ‡

Cannot find type '_opaque_Hashable' in scope

Starting new project.

SwiftUI
Minimum Deployment - iOS 14
Xcode 14.2

Added Reactor as dependency. It wont be able to build. Giving me error on Reactor/Sources/Intramodular/Dispatch/ReactorDispatchItem.swift

reactor-error

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.