MCPcopy Create free account
hub / github.com/dailydotdev/apps / changeKey

Function changeKey

packages/shared/src/features/feedExplain/useFeedTuneState.ts:18–29  ·  view source on GitHub ↗
(change: TuneChange)

Source from the content-addressed store, hash-verified

16 | { kind: 'learning'; enabled: boolean };
17
18export const changeKey = (change: TuneChange): string => {
19 switch (change.kind) {
20 case 'topic':
21 return `topic:${change.keyword}`;
22 case 'source':
23 return `source:${change.sourceId}`;
24 case 'author':
25 return `author:${change.userId}`;
26 default:
27 return 'learning';
28 }
29};
30
31// The latest change to each control, in the order they were first made.
32export const latestChanges = (changes: TuneChange[]): TuneChange[] => [

Callers 3

useFeedTuneFunction · 0.90
latestChangesFunction · 0.85
byKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected