Giter Club home page Giter Club logo

beihaozhang / easyreact Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 231.0 403 KB

Are you confused by the functors, applicatives, and monads in RxSwift and ReactiveCocoa? It doesn't matter, the concepts are so complicated that not many developers actually use them in normal projects. Is there an easy-to-use way to use reactive programming? EasyReact is born for this reason.

Home Page: https://cocoapods.org/pods/EasyReact

License: Other

Ruby 2.65% Objective-C 92.12% C 0.50% Swift 4.73%

easyreact's Introduction

EasyReact

Build Status Version License Platform codecov

Read this in other languages: 简体中文

What is EasyReact

EasyReact is an easy-to-use reactive programming framework.

Why use EasyReact

Are you confused by the functors, applicatives, and monads in RxSwift and ReactiveCocoa? It doesn't matter, the concepts are so complicated that not many developers actually use them in normal projects. Is there an easy-to-use way to use reactive programming? EasyReact is born for this reason.

Features

Note: The "Node" listed below refer to EZRNode, a unified representation of various values (all object types) in EasyReact.

Learn more

  1. Framework Overview

  2. Basic Operations

  3. Memory Management

  4. How to Contribute

Compare other Functional Reactive libraries (e.g. ReactiveCocoa or ReactiveX)

Project EasyReact ReactiveCocoa ReactiveX
Core idea Graph theory and object-oriented programming Functional programming Functional programming and generic programming
Propagation variability
Basic transformation
Combination transformation
High-order transformation
Traversal node/signal
Multi-language support Objective-C
(Other language versions will open source in the future)
Objective-C, Swift Many language versions
Performance faster slow fastest
Chinese document support
Debugging tools Topology display
More rich dynamic debugging tools(Coming soon)
Instrument

System Requirements

  • iOS 8.0 +
  • Xcode 8.0 +

How to run the example project

git clone this repo,excute pod install in Example/, then open EasyReact.xcworkspace.

Installation

CocoaPods

Add the following content in Podfile

pod 'EasyReact'

Then execute pod install

How to use (For a more detailed example, please see the test specs in the example project Tests/)

Unit Test

EasyReact contains a complete unit test with the relevant code in the Example/Tests folder. You can open the sample project and execute the Test command to run these unit tests.

Time-consuming Benchmarking with EasyReact, ReactiveCocoa, RxSwift Common APIs

Environment

Mac OS 10.12.6, CPU: 2.9GHz, Core i5 Xcode 9, iOS11, iPhone 8 Plus simulator

Cases

  1. Single stage operations, such as listener, map, filter, flattenMap, etc.
  2. Multicast operations, such as combine, zip, merge, etc.
  3. syncWith operations

The scale of the test is based on 10 operating objects and 1000 triggers. For example, the listener method has 10 listeners and repeats the action of sending the value 1000 times. The unit of time is ns.

Result data

Repeat the above experiment 10 times to get the data as follows:

name listener map filter flattenMap combine zip merge syncWith
EZRNode 4775053 57487844 13851412 11966681 18972713 134567221 36076535 18388601
ReactiveCocoa 6273485 102644235 66771529 80881225 496207382 327464977 29010632 100022454
RAC:EZRNode 131.38% 178.55% 482.06% 675.89% 2615.37% 243.35% 80.41% 543.94%

benchmark

Summary

ReactiveCocoa's average time consuming is 618.87% times more than EasyReact.

EasyReact will compare benchmark with RxSwift when the Swift version open source recently.

Authors

William Zang, [email protected]
姜沂, [email protected]
Qin Hong, [email protected]
SketchK, [email protected]
zesming, [email protected]
Zhiyu Wong, [email protected]
johnnywjy, [email protected]
qiezishu, [email protected]

License

EasyReact is Apache Public License 2.0

easyreact's People

Contributors

drummerchin avatar johnnywjy avatar qiezishu avatar swiftsiqi avatar valiantcat avatar williamzang avatar zesming avatar zhiyuwong avatar

Stargazers

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

Watchers

 avatar  avatar

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.