danielt1263 / cle-architecture-tools Goto Github PK
View Code? Open in Web Editor NEWA library for helping conform to the Cause-Logic-Effect Architecture.
License: MIT License
A library for helping conform to the Cause-Logic-Effect Architecture.
License: MIT License
Hello,
I am trying to implement a "state machine" pattern. I found the necessary tools for that in this library.
However, in the process I get strange behavior of this method:
cycle<State, Input>(
input: Observable<Input>,
initialState: State,
reduce: @escaping (inout State, Input) -> Void,
reaction: @escaping Reaction<State, Input>
)
Look at the screen image where I get the results in the wrong order. After "20" I expect to see "21, 22, ..." (a new page), but I get the first page twice.
It may also not react to my actions or react twice to the single action.
I have had experience with the RxFeedback framework and I find this approaches very similar (or not?).
So I tried to use RxFeedback for the same purpose and it works fine.
I assume I made some mistakes in the CLE approach, but I can't figure it out, because I'm new to "unidirectional systems".
For the demonstration I prepared a classic "infinite scroll" project using both approaches. The source code of identical, but the result is not.
I think it would be better if I show my repository with a simple demo project.
https://github.com/rezuantpr/RxFeedback-vs-CLE
Thanks for any help
P.s. Just compare "RxFeedbackPagingViewModel.swift" and "CLEPagingVewModel.swift" files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.