UNPKG

@tanstack/db

Version:

A reactive client store for building super fast apps on sync

62 lines (58 loc) • 2.29 kB
const require_errors = require("../errors.cjs"); var CollectionRequiresGetKeyError = class extends require_errors.CollectionConfigurationError { constructor() { super("Collection requires a \"getKey\" function in the config.\n\nThe getKey function extracts a unique identifier from each item.\n\nExample:\n createCollection({\n getKey: (item) => item.id,\n sync: { sync: () => {} },\n })"); } }; var InvalidGetKeyError = class extends require_errors.CollectionConfigurationError { constructor(actualType) { super(`"getKey" must be a function, but received ${actualType}. Example: createCollection({ getKey: (item) => item.id, sync: { sync: () => {} }, })`); } }; var InvalidSyncConfigError = class extends require_errors.CollectionConfigurationError { constructor(actualType) { super(`"sync" must be an object with a "sync" function, but received ${actualType}. Example: createCollection({ getKey: (item) => item.id, sync: { sync: ({ begin, write, commit, markReady }) => { // your sync logic }, }, })`); } }; var InvalidSyncFunctionError = class extends require_errors.CollectionConfigurationError { constructor(actualType) { super(`"sync.sync" must be a function, but received ${actualType}. The sync property should be an object containing a sync function: sync: { sync: ({ begin, write, commit, markReady }) => { // your sync logic }, }`); } }; var InvalidCallbackOptionError = class extends require_errors.CollectionConfigurationError { constructor(optionName, actualType) { super(`"${optionName}" must be a function, but received ${actualType}.`); } }; var InvalidOptionTypeError = class extends require_errors.CollectionConfigurationError { constructor(optionName, expectedType, actualType) { super(`"${optionName}" must be ${expectedType}, but received ${actualType}.`); } }; exports.CollectionRequiresGetKeyError = CollectionRequiresGetKeyError; exports.InvalidCallbackOptionError = InvalidCallbackOptionError; exports.InvalidGetKeyError = InvalidGetKeyError; exports.InvalidOptionTypeError = InvalidOptionTypeError; exports.InvalidSyncConfigError = InvalidSyncConfigError; exports.InvalidSyncFunctionError = InvalidSyncFunctionError; //# sourceMappingURL=config-errors.cjs.map