{
  "id": "@typed/ui/index#Collection.register",
  "canonicalId": "@typed/ui/Collection#register",
  "symbol": {
    "id": "@typed/ui/index#Collection.register",
    "packageName": "@typed/ui",
    "moduleName": "index",
    "exportName": "Collection.register",
    "kind": "function",
    "signatures": [
      "export declare function register<Value, Element extends object, E, R>(collection: RefSubject.RefSubject<State<Value, Element>, E, R>, item: Item<Value, Element>): Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "summary": "Upserts an item immediately and installs a finalizer in the Scope that runs this Effect; the\nfinalizer removes only that exact registration.",
    "sections": {
      "Why": "The operation exposes Collection's transition directly so callers can compose it in Effect\nprograms and native event handlers.",
      "Ownership and lifetime": "Registration is owned by the Scope in which the registration Effect runs. Closing that Scope\nremoves the exact registered item; creating the collection or state does not own this cleanup.",
      "Example": "Import with `import { register } from \"@typed/ui/Collection\";` Extend the [Collection.makeState\nrunnable setup](/reference/%40typed%2Fui%2FCollection%23makeState). Inside the linked Effect\nprogram invoke `yield* register(collection, { id: \"save\", value: \"save\" })`, then read the\ncollection to observe the inserted item."
    },
    "examples": [],
    "relations": [],
    "source": {
      "file": "packages/ui/src/Collection.ts",
      "line": 169
    },
    "since": "1.0.0",
    "category": "Item registration"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/ui/index#Collection.register",
    "packageName": "@typed/ui",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": "index",
    "consumerSpecifier": "@typed/ui/index",
    "exportName": "Collection",
    "qualifiedName": "Collection.register",
    "declarationKey": "declaration:3a2186957773c900405ecf81",
    "family": "function",
    "signatures": [
      "export declare function register<Value, Element extends object, E, R>(collection: RefSubject.RefSubject<State<Value, Element>, E, R>, item: Item<Value, Element>): Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Collection.ts",
        "start": {
          "line": 169,
          "column": 1
        },
        "end": {
          "line": 186,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/ui#Collection.register",
      "@typed/ui/Collection#register"
    ],
    "isAlias": true,
    "parentId": "@typed/ui/index#Collection",
    "static": false,
    "importedFrom": "declaration:3a2186957773c900405ecf81"
  },
  "declaration": {
    "declarationKey": "declaration:3a2186957773c900405ecf81",
    "name": "register",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function register<Value, Element extends object, E, R>(collection: RefSubject.RefSubject<State<Value, Element>, E, R>, item: Item<Value, Element>): Effect.Effect<void, E, R | Scope.Scope>;"
        ],
        "typeParameters": [
          "Value",
          "Element extends object",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/ui/src/Collection.ts",
            "start": {
              "line": 169,
              "column": 1
            },
            "end": {
              "line": 186,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function register<Value, Element extends object, E, R>(collection: RefSubject.RefSubject<State<Value, Element>, E, R>, item: Item<Value, Element>): Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "typeParameters": [
      "Value",
      "Element extends object",
      "E",
      "R"
    ],
    "summary": "Upserts an item immediately and installs a finalizer in the Scope that runs this Effect; the\nfinalizer removes only that exact registration.",
    "sections": {
      "Why": "The operation exposes Collection's transition directly so callers can compose it in Effect\nprograms and native event handlers.",
      "Ownership and lifetime": "Registration is owned by the Scope in which the registration Effect runs. Closing that Scope\nremoves the exact registered item; creating the collection or state does not own this cleanup.",
      "Example": "Import with `import { register } from \"@typed/ui/Collection\";` Extend the [Collection.makeState\nrunnable setup](/reference/%40typed%2Fui%2FCollection%23makeState). Inside the linked Effect\nprogram invoke `yield* register(collection, { id: \"save\", value: \"save\" })`, then read the\ncollection to observe the inserted item."
    },
    "examples": [],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Collection.ts",
        "start": {
          "line": 169,
          "column": 1
        },
        "end": {
          "line": 186,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Item registration"
  }
}
