Jump to content

Potential API request: simplified extension settings


agc93

Recommended Posts

Figured I'd open a topic here for discussion rather than clog up GitHub with wild fancies:

 

Is there any chance we might see an API in future for extensions to manage extension-specific or game-specific settings without having to build out all the moving parts that currently requires?

 

---

 

For context, I have almost no experience with React and have never used Redux (or any observer pattern designs, realistically). To have a single boolean flag that a user can change currently requires:

 

  • A React component to register with registerSettings
  • Creating a new action (I think)
  • Creating a new reducer (possibly with the ability to merge existing state?)
  • Wiring up the Settings component to the state store, and to the new action (this is super confusing for new people)

 

Having now spent about 4 hours working on that, the last step isn't working for me and the whole thing is approaching "too hard" territory.

 

---

 

My ideal scenario would be that an extension could register very simple preferences (maybe only booleans or strings), using a simplified API that could be shown in the Settings page. Essentially something similar to how profile features are implemented, but not profile-specific for simple toggles.

 

Is this something there might be interest in? Blockers I'm not thinking of? Just trying to throw out an idea here based on a pain point I've had.

Link to comment
Share on other sites

Awesome! That would really make building out extension functionality a lot easier if I could reliably do settings without having to build all the parts myself :)

As for my code specifically, if you get a chance it's been pushed to agc93/beatvortex , but the actual register call has been commented out since it blows up the moment I try and change a setting.

Link to comment
Share on other sites

I just made a pull request that would fix the problem: https://github.com/agc93/beatvortex/pull/3

 

The main problem was that you export both the original OneClickSettings class (by name) as well as the one wrapped by connect (as default), when you import you use the original class which therefore isn't connected to the store at all.

 

This is maybe the misunderstanding: connect doesn't modify the class it is used on, it instead creates a new one with added functionality.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...