-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from regal/feat-104/prototype-registry
Prototype Registry: Replace numeric OutputLine.id and EventRecord.id with PKs
- Loading branch information
Showing
28 changed files
with
755 additions
and
627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Contains the `EventRecord` primary key system. | ||
* | ||
* Copyright (c) Joseph R Cowman | ||
* Licensed under MIT License (see https://github.com/regal/regal) | ||
*/ | ||
|
||
import { buildPKProvider } from "../../common"; | ||
import { EventRecord } from "../event-record"; | ||
|
||
/** The set of reserved `EventRecord` primary keys. */ | ||
export const EVENT_RESERVED_KEYS = { | ||
/** | ||
* The key for all changes made in the default, untracked `EventRecord`. | ||
* | ||
* **No reserved event keys should have a greater value than this!** | ||
*/ | ||
UNTRACKED: 100 | ||
}; | ||
|
||
/** | ||
* Reference this `PKProvider` for helper functions to get reserved `EventRecord` | ||
* PKs so we don't have to do additional instantiations. | ||
*/ | ||
const INTERNAL_EVENT_PK_PROVIDER = buildPKProvider<EventRecord>( | ||
EVENT_RESERVED_KEYS | ||
); | ||
|
||
/** Shorthand for the `EVENT_RESERVED_KEYS.UNTRACKED` primary key. */ | ||
export const getUntrackedEventPK = () => | ||
INTERNAL_EVENT_PK_PROVIDER.reserved(EVENT_RESERVED_KEYS.UNTRACKED); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.