Skip to content

Clarifying the state API #75

Description

@chrisvfritz

I noticed this one line required a fair bit of explanation in the tutorial:

@props.app-state.get \state.query

I think part of the reason is the state. prefix is passed in as a parameter when it's really a mandatory part of the API for fetching state. It may be useful to have an additional function, get-state, which simply assumes the state. prefix. For example:

@props.app-state.get-state \query

This wouldn't replace the more general purpose get function, but would allow users of the framework to put off learning more about Arch's internals until they're doing non-trivial things with it.

Then there's one other change I'd like to request. I'm not sure if it's too far into Arch's development to change this, but what would you think about renaming app-state to just app?

@props.app.get-state \query

I believe I understand the reason for calling it app-state - it does contain state other than component state. At the same time though, state has become synonymous with component state in the React world, so I fear using the word (even appropriately) to describe other kinds of state will inevitably cause confusion for newcomers to the framework.

What are your thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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