Git Product home page Git Product logo

flax's People

Contributors

codyengel avatar wiyarmir 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

Watchers

 avatar

flax's Issues

Allow the Store to handle process death.

Since Android is unpredictable it would probably be a good idea to allow the Store to survive process death: https://medium.com/inloop/android-process-kill-and-the-big-implications-for-your-app-1ecbed4921cb

Currently device rotation works fine, however if the application is killed and you return none of the data remains, even worse if you are in an area of the app expecting data to be there the application will crash.

There are a few options out there:

  1. Allow each responder notify the model when the activity has been paused, at that time the developer can decide if they need to persist that model through process death (as in they should store the data on disk).
  2. Handle this automatically for the developer, this can be done through the Application class and registering ActivityLifecycleCallbacks to notify the Store of changes in the application state.

In either case these are the important callbacks in order of when they are called:

  1. onActivityPaused
  2. onActivitySaveInstanceState
  3. onActivityStopped
  4. onTrimMemory

onActivitySaveInstanceState would probably make the most sense since that's traditionally where you would want to save state.

Model should emit non-mutable representation of self when changes are made.

Currently the Model emits itself when changes are made, this isn't ideal for a number of reasons:

  1. The model state could change inbetween onNext calls causing the renderer to render an inaccurate state.
  2. The render could call a mutator on the model which isn't ideal and could potentially cause an infinite loop depending on where it is called.

There haven't been issues with the model yet in the sample projects but it's probably better to take care of this problem sooner rather than later.

Remove Rx from library.

Completely remove Rx from the Flax module. Updating sample apps will be a separate issue.

Finalize default FlaxActions

Currently the FlaxAction types are fairly primitive and should be updated to support a wider range of default Action types.

These actions include callbacks from View, TextView, EditText, System (Activity, Fragment, etc), as well as others. Looking over RxBindings will likely give a good idea of what should be supported in terms of view callbacks. System callbacks will likely need to be custom and creating an AbstractFlaxActivity, AbstractFlaxFragment, and AbstractFlaxViewGroup with observables for each lifecycle event will likely be useful.

Add JavaDoc

We aren't savages, so add JavaDoc to the Flax module. This will include class and method documentation.

Release to jCenter

Flax needs to be properly released to jCenter so that it can be easier to include in projects.

simple network example crash on start-up

    05-02 18:48:54.869 1956-1956/com.codyengel.simplenetworking E/AndroidRuntime: FATAL EXCEPTION: main
                                                                          Process: com.codyengel.simplenetworking, PID: 1956
                                                                          java.lang.RuntimeException: Unable to resume activity {com.codyengel.simplenetworking/com.codyengel.simplenetworking.ui.list.ListActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'io.reactivex.Observable com.codyengel.flax.FlaxModel.getObservable()' on a null object reference
                                                                              at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2986)
                                                                              at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017)
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
                                                                              at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                              at android.os.Looper.loop(Looper.java:135)
                                                                              at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                                              at java.lang.reflect.Method.invoke(Method.java:372)
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                                           Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'io.reactivex.Observable com.codyengel.flax.FlaxModel.getObservable()' on a null object reference
                                                                              at com.codyengel.flax.FlaxRenderer.getObservable(FlaxRenderer.java:51)
                                                                              at com.codyengel.flax.FlaxRenderer.<init>(FlaxRenderer.java:35)
                                                                              at com.codyengel.simplenetworking.ui.list.ListRenderer.<init>(ListRenderer.java:32)
                                                                              at com.codyengel.simplenetworking.ui.list.ListActivity.createRenderer(ListActivity.java:77)
                                                                              at com.codyengel.simplenetworking.AbstractFlaxActivity.onResume(AbstractFlaxActivity.java:50)
                                                                              at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257)
                                                                              at android.app.Activity.performResume(Activity.java:6076)
                                                                              at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2975)
                                                                              at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017) 
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392) 
                                                                              at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                              at android.os.Looper.loop(Looper.java:135) 
                                                                              at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                              at java.lang.reflect.Method.invoke(Native Method) 
                                                                              at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 

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.