Created
May 1, 2017 16:23
-
-
Save justinmakaila/d401a146da2fba4c6d069de6cd8c9cdc to your computer and use it in GitHub Desktop.
NormalizedCacheSnapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public protocol NormalizedCache { | |
/// Loads records corresponding to the given keys. | |
/// - returns: A promise that fulfills with an array, with each index containing either the | |
/// record corresponding to the key at that index or nil if not found. | |
func loadRecords(forKeys keys: [CacheKey]) -> Promise<[Record?]> | |
/// Merges a set of records into the cache. | |
/// - returns: A promise that fulfills with a set of keys corresponding to *fields* that have | |
/// changed (i.e. QUERY_ROOT.Foo.myField). These are the same type of keys as are | |
/// returned by RecordSet.merge(records:). | |
func merge(records: RecordSet) -> Promise<Set<CacheKey>> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment