lgvalle / android-flux-todo-app Goto Github PK
View Code? Open in Web Editor NEWExample of how to implement an Android TODO App using Facebook Flux Architecture
Example of how to implement an Android TODO App using Facebook Flux Architecture
i don't konw how can i use the broadcast in this Architecture
In this architecture, ActionCreator
file contains:
User interact with UI
. However there are many activities, and many interaction
.I think there are many methods in ActionCreator
file.
As shown, all calls are one-way, but in your code is : View -> Actions Creator -> Action -> Dispatcher -> Store -> Dispatcher -> View. which calls the dispatcher in TodoStore not feeling well.
... since you're already using RxJava. Square also recommends switching to it.
Deprecated!
This project is deprecated in favor of RxJava and RxAndroid. These projects permit the same event-driven programming model as Otto, but they’re more capable and offer better control of threading.
#Hi lgvalle,
Thankyou for the code implementation, that help me understand flux architecture really well.
I have implemented your architecture in my code. But at one point came I had to break the rule of single dispatcher which is the core of flux architecture.
While there are some actions that are being propagate through UI, I have a background service that hits api server every 30 seconds. As soon as one store working on UI event, another store change event from background service register by dispatcher that nullifies my last change event call and post a null object to OTTO event bus hence view controller in UI never informed that the task is finished. To resolve this problem I had to create another dispatcher to keep background service work on separate thread thus ended up in breaking the rule of single dispatcher.
Please help me to resolve my issue.
Omama Moin
Steps to reproduce:
Result:
you see empty list and the input view with opened keyboard. Even if you close the keyboard, the list still empty.
The list is refreshed again once you enter new item.
Thanks for this very good example it helped me a lot to get started with the flux architecture. And I am implementing it in my application.
I am wondering, if by having a reference to the Dispatcher in the Store and emitting the Store changes event with this Dispatcher you are not breaking the unidirectional principal ?
I think that by using the dispatcher to emit the the event the event goes back from store to the dispatcher. It is where I think there is a problem in your implementation.
If the store was able to emit changes directly to the view then I think the flow will be respected.
Let me know what you think about it
Kevin,
In a screen, I have an Activity, 3 fragments and a Store. How do I get data from Store and pass to the Activity and Fragments?
In your architecture, I don't know where is right place of DB layer (ORM, datasource, sqlite, ...)
Could you explain (or draw architecture) detail of DB layer ?
Hi,
I am new start of Flux.
Step :
Questions:
Is trigger the popup from Activity directly?
OR
Activity (passing message & activity [Home Activity]) => ActionCreator => Dispatcher => Store (invoke activity function to display popup with the message passing in from first step) => Activity (same activity [Home Activity])?
Should keep the message in Store instead of intent?
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.