Git Product home page Git Product logo

frox's Introduction

Frox (forked from Grox)

Frox helps to maintain the state of Java / Android apps.

Understanding Grox

Grox Overview

Video

Grox video

We have a nice video to explain how the Grox sample app works.

Wiki

Visit the Grox wiki

Grox in a nutshell

Grox provides developers with the basic bricks to:

  • create a state of a UI / Application
  • perform pure changes on this state,
  • be notified of state changes (i.e. to update the UI)
  • perform other "side-effects" operations (network calls, manipulating files, etc.)
  • log, persist, create an history of states and state changes

Basic Usage

Very simple example:

//create a store with an initial state
Store<String> store = new Store<>("Hello");
//when the store's state changes, update your UI
states(store).subscribe(System.out::println);
//start dispatching actions to your store...
store.dispatch(oldState -> oldState + " Grox");

A command example

public class RefreshResultRxAction implements RxAction {
 @Override
  public Observable<Action> actions() {
    return getResultFromServer() //via retrofit
        .subscribeOn(io())
        .map(ChangeResultAction::new) //convert all your results into actions
        .cast(Action.class)
        .onErrorReturn(ErrorAction::new) //including errors
        .startWith(fromCallable(RefreshAction::new)); //and progress
  }
}

//then use your RxAction via Rx + RxBinding
subscriptions.add(
        clicks(button)
            .map(click -> new RefreshResulRxAction())
            .flatMap(Command::actions)
            .subscribe(store::dispatch));

Browse Grox sample for more details.

Setup

    //note that Grox is also available without Rx dependencies
    implementation 'com.groupon.grox:grox-core-rx:x.y.z'
    //Grox commands artifacts do depend on Rx (1 or 2)
    implementation 'com.groupon.grox:grox-commands-rx:x.y.z'
    implementation 'com.groupon.grox:grox-commands-rx2:x.y.z'

Main features

The main features of Grox are:

  • unify state management. All parts of an app, all screens for instance, can use Grox to unify their handling of state.
  • allows time travel debugging, undo, redo, logging, etc. via middlewares.
  • simple API. Grox is inspired by Redux & Flux but offers a simpler approach.
  • easily integrated with Rx1 and 2. Note that it is also possible to use Grox without Rx.
  • Grox only relies on a few concepts: States, Actions, Stores, MiddleWare.

Links

Conferences, talks & articles

Credits

The following people have been active contributors to the first version of Grox:

  • Shaheen Ghiassy
  • Michael Ma
  • Matthijs Mullender
  • Turcu Alin
  • Samuel Guirado Navarro
  • Keith Smyth
  • Stephane Nicolas

Inspired by

Grox - Java library for state management, inspired by Flux, Redux, Cycle, and Rx Managed State.

frox's People

Contributors

stephanenicolas avatar alin-turcu avatar digitalbuddha avatar wongcain avatar saguinav avatar gracefulife avatar code-twister avatar

Watchers

 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.