Yarikx / reductor

Redux for Android. Predictable state container library for Java/Android
Apache License 2.0
463 stars 27 forks source link

Is it possible to use reductor without android? #21

Closed se-panfilov closed 7 years ago

se-panfilov commented 7 years ago

Hey, thanks for reductor. It's not an issue, but a question. And yeah, I'm not really good at java.

I have two questions:

  1. Is it possible (a good idea?) to use reductor on pure java app (not android)?

  2. Some parts of example confusing me. Like this one:

 public static CounterReducer create() {
        return new CounterReducerImpl(); //Note: usage of generated class
    }

Is that an android magic?

Yarikx commented 7 years ago

Hi @se-panfilov,

  1. Yes! Reductor does not depend on android or any other dependency. Therefore you can use it in pure Java app. The only thing that might be different is how you add annotation processing to your build config. Is it a good idea or not depends of type and architecture of your app.

  2. That's not a magic, but annotation processor who knows how to generate CounterReducerImpl.

Reductor contains two parts: Library and annotation processor. The latter is responsible for this kind of magic

se-panfilov commented 7 years ago

@Yarikx Thanks for answers.

I'll close issue, but tbh It would be good to have an example with setup for non-android environment. Cause me and perhaps other guys may feel troubles with that.