Skip to content
module@warp-drive/core

Interface StoreSetupOptions<T>

Defined in: warp-drive-packages/core/src/index.ts:70

Options for setting up a Store instance with useRecommendedStore.

Type Parameters

T

T extends Cache = Cache

Properties

cache

ts
cache: (capabilities) => T;

Defined in: warp-drive-packages/core/src/index.ts:75

A constructor for the Cache implementation to use, receiving the store's CacheCapabilitiesManager when instantiated.

Constructs a new Cache instance for the store.

Parameters

capabilities

CacheCapabilitiesManager

Returns

T


CAUTION_MEGA_DANGER_ZONE_extensions?

ts
optional CAUTION_MEGA_DANGER_ZONE_extensions?: CAUTION_MEGA_DANGER_ZONE_Extension[];

Defined in: warp-drive-packages/core/src/index.ts:137

Extensions to use with resources, objects and arrays to provide custom behaviors and capabilities that are not described by Schema.

This feature should only be used during a transition period to support migrating towards schemas from existing Model and ModelFragments implementations.


derivations?

ts
optional derivations?: Derivation[];

Defined in: warp-drive-packages/core/src/index.ts:121

Derivations to use for derived fields.


handlers?

ts
optional handlers?: 
  | Handler[]
  | ((store) => Handler[]);

Defined in: warp-drive-packages/core/src/index.ts:107

The request handlers to use. Fetch will automatically be added to the end of the handler chain and CacheHandler will automatically be added as the cache handler.

May also be given as a function that receives the Store instance and returns the handlers to use. This is useful when a handler needs access to the store (e.g. to look up its owner for injections) or when the set of handlers should be decided lazily (e.g. based on a feature flag service that may not be ready until after the store is constructed).

The function is invoked lazily, the first time the store's requestManager is accessed, and only once per store instance.

See the "Adding Stateful Handlers" section of useRecommendedStore for an example of using this callback to construct a handler that needs access to an Ember service.


hashFns?

ts
optional hashFns?: HashFn[];

Defined in: warp-drive-packages/core/src/index.ts:129

Hash Functions to use for embedded object identity and polymorphic type calculations


policy?

ts
optional policy?: CachePolicy;

Defined in: warp-drive-packages/core/src/index.ts:88

The Cache policy to use.

Defaults to DefaultCachePolicy configured to respect Expires, X-WarpDrive-Expires, and Cache-Control headers with a fallback to 30s soft expiration and 15m hard expiration.


schemas?

ts
optional schemas?: (
  | PolarisResourceSchema
  | ObjectSchema)[];

Defined in: warp-drive-packages/core/src/index.ts:113

Schemas describing the structure of your resource data.

See , and ObjectSchema for more information.


traits?

ts
optional traits?: Trait[];

Defined in: warp-drive-packages/core/src/index.ts:117

Traits to use with , | Resource Schemas


transformations?

ts
optional transformations?: Transformation[];

Defined in: warp-drive-packages/core/src/index.ts:125

Transformations to use for transforming fields.

Released under the MIT License.