{
  "id": "@typed/fx#RefSubject.reset",
  "canonicalId": "@typed/fx/RefSubject#reset",
  "symbol": {
    "id": "@typed/fx#RefSubject.reset",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.reset",
    "kind": "function",
    "signatures": [
      "export declare function reset<A, E, R>(ref: RefSubject<A, E, R>): Effect.Effect<Option.Option<A>, E, R>;"
    ],
    "summary": "Resets a `RefSubject` to its initial value, returning the previous value if it existed.",
    "sections": {
      "Why": "Resets a `RefSubject` to its initial value, returning the previous value if it existed. The\ntransition is serialized at the RefSubject rather than coordinated by callers or UI components.",
      "Ownership and lifetime": "Running reset performs one serialized subject transition and resolves with its committed value.\nIt acquires no resource; failures and services remain those of the source ref."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const count = yield* RefSubject.make(0)\n\n  yield* RefSubject.set(count, 5)\n  const before = yield* count\n  console.log(before) // 5\n\n  // Reset to initial value\n  const previous = yield* RefSubject.reset(count)\n  console.log(Option.isSome(previous)) // true\n  console.log(previous.value) // 5\n\n  const after = yield* count\n  console.log(after) // 0\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 2196
    },
    "since": "1.0.0",
    "category": "State updates"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.reset",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.reset",
    "declarationKey": "declaration:1c425e09447834c897d31c93",
    "family": "function",
    "signatures": [
      "export declare function reset<A, E, R>(ref: RefSubject<A, E, R>): Effect.Effect<Option.Option<A>, E, R>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 2196,
          "column": 1
        },
        "end": {
          "line": 2198,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx#RefSubject.delete",
      "@typed/fx/RefSubject#delete",
      "@typed/fx/RefSubject#reset"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:1c425e09447834c897d31c93"
  },
  "declaration": {
    "declarationKey": "declaration:1c425e09447834c897d31c93",
    "name": "reset",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function reset<A, E, R>(ref: RefSubject<A, E, R>): Effect.Effect<Option.Option<A>, E, R>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 2196,
              "column": 1
            },
            "end": {
              "line": 2198,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function reset<A, E, R>(ref: RefSubject<A, E, R>): Effect.Effect<Option.Option<A>, E, R>;"
    ],
    "typeParameters": [
      "A",
      "E",
      "R"
    ],
    "summary": "Resets a `RefSubject` to its initial value, returning the previous value if it existed.",
    "sections": {
      "Why": "Resets a `RefSubject` to its initial value, returning the previous value if it existed. The\ntransition is serialized at the RefSubject rather than coordinated by callers or UI components.",
      "Ownership and lifetime": "Running reset performs one serialized subject transition and resolves with its committed value.\nIt acquires no resource; failures and services remain those of the source ref."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const count = yield* RefSubject.make(0)\n\n  yield* RefSubject.set(count, 5)\n  const before = yield* count\n  console.log(before) // 5\n\n  // Reset to initial value\n  const previous = yield* RefSubject.reset(count)\n  console.log(Option.isSome(previous)) // true\n  console.log(previous.value) // 5\n\n  const after = yield* count\n  console.log(after) // 0\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 2196,
          "column": 1
        },
        "end": {
          "line": 2198,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "State updates"
  }
}
