Skip to content

store .manage() resources#77

Open
jbolda wants to merge 6 commits intomainfrom
store-resources
Open

store .manage() resources#77
jbolda wants to merge 6 commits intomainfrom
store-resources

Conversation

@jbolda
Copy link
Collaborator

@jbolda jbolda commented Jan 12, 2026

Motivation

Pulled out the .manage() API from #67. We could still iterate on #67 a bit, but the resource handling is likely ready to move forward.

@jbolda jbolda requested a review from neurosnap January 12, 2026 18:26
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 12, 2026

More templates

npm i https://pkg.pr.new/fxforge/starfx@77

commit: 6ffcc4b

@jbolda
Copy link
Collaborator Author

jbolda commented Jan 12, 2026

@neurosnap I added an effection resource doc, but didn't link it anywhere. Recommendations how/where we might include this in the narrative?

@neurosnap
Copy link
Collaborator

Would you consider this advanced usage?

@jbolda
Copy link
Collaborator Author

jbolda commented Jan 12, 2026

Hmm at the current time I might? You could, for example, grab the @effectionx/worker package though, drop it in here, and just start using it. The DX and ease of use can be relatively inviting though. I suspect that not everyone will need this, and if you would, you could likely be looking for it. As such, advanced usage section feels reasonable.

@jbolda
Copy link
Collaborator Author

jbolda commented Jan 13, 2026

I added it as a section under the guides for now unless you have a better idea, @neurosnap.

});
}

function manage<Resource>(name: string, inputResource: Operation<Resource>) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, help me understand why this should live within our store which mostly deals with our single global object. If I were designing this API I would probably keep it at the thunk level. Is the problem that we need to share the same instance of an object across all thunks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be the specific use case, yes. So you could opt to "share" it at a specific thunk level via thunk.manage or make it "globally" available at store.manage. We effectively have these two "levels" where we could establish context, and it feels useful to enable at both.

@jbolda
Copy link
Collaborator Author

jbolda commented Feb 10, 2026

It is not immediately clear why slice is undefined in that test. Will want to clear that up before we move forward here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants