Skip to content

Commit

Permalink
refactor(daemon): Rename followIdNameChanges to followNameChangesForId
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Apr 13, 2024
1 parent 6c90ea6 commit aa8be0b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/daemon/src/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const makeDirectoryMaker = ({
locator,
) {
const id = idFromLocator(locator);
for await (const idDiff of petStore.followIdNameChanges(id)) {
for await (const idDiff of petStore.followNameChangesForId(id)) {
/** @type {any} */
const locatorDiff = {
...idDiff,
Expand Down
8 changes: 4 additions & 4 deletions packages/daemon/src/pet-sitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export const makePetSitter = (petStore, specialNames) => {
yield* petStore.followNameChanges();
};

/** @type {import('./types.js').PetStore['followIdNameChanges']} */
const followIdNameChanges = async function* currentAndSubsequentIds(id) {
const subscription = petStore.followIdNameChanges(id);
/** @type {import('./types.js').PetStore['followNameChangesForId']} */
const followNameChangesForId = async function* currentAndSubsequentIds(id) {
const subscription = petStore.followNameChangesForId(id);

const [idSpecialName] = Object.entries(specialNames)
.filter(([_, specialId]) => specialId === id)
Expand Down Expand Up @@ -96,7 +96,7 @@ export const makePetSitter = (petStore, specialNames) => {
identifyLocal,
reverseIdentify,
list,
followIdNameChanges,
followNameChangesForId,
followNameChanges,
write,
remove,
Expand Down
6 changes: 3 additions & 3 deletions packages/daemon/src/pet-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export const makePetStoreMaker = (filePowers, locator) => {
yield* subscription;
};

/** @type {import('./types.js').PetStore['followIdNameChanges']} */
const followIdNameChanges = async function* currentAndSubsequentIds(id) {
/** @type {import('./types.js').PetStore['followNameChangesForId']} */
const followNameChangesForId = async function* currentAndSubsequentIds(id) {
if (!idsToTopics.has(id)) {
idsToTopics.set(id, makeIdChangeTopic());
}
Expand Down Expand Up @@ -228,7 +228,7 @@ export const makePetStoreMaker = (filePowers, locator) => {
identifyLocal,
reverseIdentify,
list,
followIdNameChanges,
followNameChangesForId,
followNameChanges,
write,
remove,
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export interface PetStore {
* Then publishes diffs as names are added and removed, or if the id is itself removed.
* @throws If attempting to follow an id with no names.
*/
followIdNameChanges(
followNameChangesForId(
id: string,
): AsyncGenerator<PetStoreIdDiff, undefined, undefined>;
write(petName: string, id: string): Promise<void>;
Expand Down

0 comments on commit aa8be0b

Please sign in to comment.