Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): ActivityLoaderArgs.config #519

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

tonyfromundefined
Copy link
Member

@tonyfromundefined tonyfromundefined commented Sep 24, 2024

내용

// 인터페이스 확장
declare module "@stackflow/config" {
  interface Config<T extends ActivityDefinition<string>> {
    myApiClient: MyApiClient;
  }
}

// Decorator
const config = defineConfig({ /* ... */ });
config.decorate("myApiClient", myApiClient);

// MyActivity.loader.ts
export function loader({ params, config }: ActivityLoaderArgs<"MyActivity">) {
  config.myApiClient.get("https://...")
}

Copy link

changeset-bot bot commented Sep 24, 2024

🦋 Changeset detected

Latest commit: ae4bc78

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@stackflow/react Minor
@stackflow/link Minor
@stackflow/config Minor
@stackflow/docs Patch
@stackflow/demo Patch
@stackflow/plugin-history-sync Patch
@stackflow/plugin-preload Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
stackflow-docs ✅ Ready (Inspect) Visit Preview Sep 25, 2024 11:06am

@tonyfromundefined tonyfromundefined merged commit 412de46 into main Sep 26, 2024
4 checks passed
@tonyfromundefined tonyfromundefined deleted the add-config-in-activity-loader-args branch September 26, 2024 01:54
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