MCPcopy Create free account
hub / github.com/CSFrequency/react-firebase-hooks / setValue

Function setValue

database/helpers/useListReducer.ts:129–151  ·  view source on GitHub ↗
(snapshots: DataSnapshot[] | null)

Source from the content-addressed store, hash-verified

127};
128
129const setValue = (snapshots: DataSnapshot[] | null): KeyValueState => {
130 if (!snapshots) {
131 return {
132 keys: [],
133 values: [],
134 };
135 }
136
137 const keys: string[] = [];
138 const values: DataSnapshot[] = [];
139 snapshots.forEach((snapshot) => {
140 if (!snapshot.key) {
141 return;
142 }
143 keys.push(snapshot.key);
144 values.push(snapshot);
145 });
146
147 return {
148 keys,
149 values,
150 };
151};
152
153const addChild = (
154 currentState: KeyValueState,

Callers 9

useObjectFunction · 0.85
listReducerFunction · 0.85
useAuthState.tsFile · 0.85
useIdToken.tsFile · 0.85
useDownloadURL.tsFile · 0.85
useCollectionFunction · 0.85
useCollectionOnceFunction · 0.85
useDocumentFunction · 0.85
useDocumentOnceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…