Skip to content

Commit

Permalink
Rename store
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodyowl committed Oct 20, 2024
1 parent 34a1a67 commit d727abf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OptionResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BOXED_TYPE } from "./symbols";
import { JsonOption, JsonResult, LooseRecord } from "./types";
import { zip } from "./ZipUnzip";

const OptionStore = createStore();
const SomeStore = createStore();

class __Option<A> {
static P = {
Expand All @@ -13,15 +13,15 @@ class __Option<A> {
};

static Some = <A = never>(value: A): Option<A> => {
const existing = OptionStore.get(value);
const existing = SomeStore.get(value);
if (existing === undefined) {
const option = Object.create(OPTION_PROTO) as Some<A>;
// @ts-expect-error
option.tag = "Some";
// @ts-expect-error
option.value = value;
Object.freeze(option);
OptionStore.set(value, option);
SomeStore.set(value, option);
return option;
} else {
return existing as Some<A>;
Expand Down

0 comments on commit d727abf

Please sign in to comment.