Class: kb.Store
Defined in: | src/core/store.coffee |
Variables Summary
- instances =
-
[]
Class Method Summary
- . (void) useOptionsOrCreate(options, obj, observable) Used to either register yourself with the existing store or to create a new store.
Instance Method Summary
- # (void) destroy() Required clean up function to break cycles, release view models, etc.
- # (void) clear() Manually clear the store
- # (void) compact() Manually compact the store by searching for released view models
- # (void) retain(observable, obj, creator) Used to register a new view model with the store.
- # (void) retainOrCreate(obj, options, deep_retain) Used to find an existing observable in the store or create a new one if it doesn't exist.
- # (void) release(observable, force) Release a reference to a a ViewModel in this store.
Class Method Details
.
(void)
useOptionsOrCreate(options, obj, observable)
Used to either register yourself with the existing store or to create a new store.
Examples:
kb.Store.useOptionsOrCreate(model, this, options);
Constructor Details
#
(void)
constructor()
Used to create a new kb.Store.
Instance Method Details
#
(void)
destroy()
Required clean up function to break cycles, release view models, etc. Can be called directly, via kb.release(object) or as a consequence of ko.releaseNode(element).
#
(void)
clear()
Manually clear the store
#
(void)
compact()
Manually compact the store by searching for released view models
#
(void)
retain(observable, obj, creator)
Used to register a new view model with the store.
Examples:
retain an observable with the store
store.retain(observable, obj, creator);
#
(void)
retainOrCreate(obj, options, deep_retain)
Used to find an existing observable in the store or create a new one if it doesn't exist.
Examples:
register an observable with the store
observable = store.retainOrCreate(value, {path: kb.utils.wrappedPath(observable), factory: kb.utils.wrappedFactory(observable)})
#
(void)
release(observable, force)
Release a reference to a a ViewModel in this store.