Skip to content

Suggestion: consider using UniRx to make state observable #52

@austinmao

Description

@austinmao

What do you think about making a reactive store using https://github.com/neuecc/UniRx ?

I'm trying to implement a reactive model of redux. It would be nice to do the following standard movement code outlined in https://ornithoptergames.com/reactiverx-in-unity3d-part-1/ but with a redux pattern:

  1. Observe input
  2. Dispatch input and transform to store
  3. Reducer calculates and stores velocity
  4. Renderer observes and reacts to change in state.velocity
  5. CharacterController.Move

I've done everything up until the fourth point. With Unidux as is, I have three options:

  1. I can store an observable in state;
  2. I can create a custom observable per state object; or
  3. Hack UniRx into Unidux.

However, I think it's better you may consider doing this in Store.cs > ForceUpdate() since I am relatively new to Unity development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions