Skip to content

Commit

Permalink
feat(store-cache): use namespace override
Browse files Browse the repository at this point in the history
  • Loading branch information
dk1a committed May 23, 2023
1 parent 36cf95d commit f2f9b08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/store-cache/src/createDatabaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { curry } from "@latticexyz/common/utils";
*/
export function createDatabaseClient<C extends StoreConfig>(database: TupleDatabase, config: C) {
const _tupleDatabaseClient = new TupleDatabaseClient(database);
const { namespace } = config;
const tables: Record<string, unknown> = {};

// Create utils with client argument prefilled
Expand All @@ -23,6 +22,7 @@ export function createDatabaseClient<C extends StoreConfig>(database: TupleDatab

// Create utils with client, namespace and table argument prefilled
for (const table in config.tables) {
const namespace = config.tables?.[table].namespace ?? config.namespace;
tables[table] = {
set: (key: Key<C, typeof table>, value: Value<C, typeof table>, options: SetOptions) =>
utilsWithClient.set(namespace, table, key, value, {
Expand Down

0 comments on commit f2f9b08

Please sign in to comment.