Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 801 Bytes

cache.md

File metadata and controls

36 lines (27 loc) · 801 Bytes

Working with Cache

Just like working with Stores, in most of the cases the default configuration is enough, but if you need to, here's how you do it.

Though Store. Optionally, the properties be static.

import {Store, Hash} from 'premiere';

class TodoStore extends Store {
    base: string = 'http://store-base.com';
    headers: Hash<string> = {customHeader: 'header'};
    useCache: boolean = false;
    usePromiseCache = false;
}

Though Model

import {Model, Hash} from 'premiere';

class TodoModel extends Model {
    static storeProperties: Hash<any> = {
        base: 'http://store-base.com',
        headers: 'http://store-base.com',
        useCache: false,
        usePromiseCache: false
    };
}