Skip to content

Question: strategies for a global workflow (redux style data store) for data that is central to the app? #1209

Open
@gregkerzhner

Description

@gregkerzhner

Thanks for open sourcing this awesome library. It seems like an awesome port of the React framework for iOS. The natural question to ask is - what about a global data store?

The hierarchical nature of Workflow makes a lot of sense for some state that closely mirrors the view hierarchy. However, other types of state is usually global to the app and independent of any view stack. Something like currentUser or authentication state is a good example of this kind of state. Where does workflow encourage me to keep such state?

It seems like out of the box I would be encouraged to keep such global data in a "root workflow" that's parent to all other workflows. However, this quickly becomes cumbersome because state from this parent workflow needs to be passed through all unrelated layers of the workflow hierarchy to get to the child workflow that actually needs it.

This issue is often called "prop drilling" in the React world and Redux exists (in part) to address it. The same problem exists with outputs - intermediary workflows would need to mindlessly pass outputs up the hierarchy leading to a lot of extra code.

Curious if you have ran into these kinds of issues while building on top of Workflow and what strategies you use to overcome them. I've only played with Workflow a bit so please excuse me if I am missing something.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions