factory-ctx

Community

Enhance dynamic provider context management in injection frameworks.

Authorjymchng
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The Skill addresses the need for scoped resolution of injectable types within dynamic provider contexts, ensuring that dependencies are resolved in a safe and efficient manner without bypassing the singleton cache.

Core Features & Use Cases

  • Scoped Resolution: Allows for the safe resolution of injectable or external types within DynProvider::with_ctx closures.
  • Singleton Cache Utilization: Ensures that singleton dependencies are resolved within their intended scope, avoiding cache bypassing.
  • Use Case: When a dynamic provider factory needs to resolve other injectable types without affecting the singleton cache, FactoryCtx is a useful tool.

Quick Start

To utilize FactoryCtx, include the following in your Skill code:

let container = Container::builder()
    .register(DynProvider::with_ctx(|ctx| async move {
        // Resolve AppConfig via FactoryCtx
        let cfg: Inject<AppConfig> = ctx.extract().await?;
        // Further operations...
    }))
    .build().await?;

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: factory-ctx
Download link: https://github.com/jymchng/injectable/archive/main.zip#factory-ctx

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 620,000+ vetted skills library on demand.