-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds onFieldUpdate, onFieldsUpdate to utils/model, and adds onModelUp…
…date, and onCollectionUpdate to Collection
- Loading branch information
1 parent
f28c642
commit d9e3cdf
Showing
9 changed files
with
179 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
import ErrorFactory from './ErrorFactory'; | ||
|
||
/** | ||
* | ||
* @class UnexpectedTypeError | ||
* @type {Error|Function} | ||
*/ | ||
export const UnexpectedTypeError = ErrorFactory(data => `Expected data to be of type {Object|Array} and got ${typeof data}`); | ||
/** | ||
* | ||
* @class UnsupportedError | ||
* @type {Error|Function} | ||
*/ | ||
export const UnsupportedError = ErrorFactory((model, indexBy) => `Model ${model.toJSON()} is missing index ${indexBy}`); | ||
/** | ||
* | ||
* @class MissingIndexError | ||
* @type {Error|Function} | ||
*/ | ||
export const MissingIndexError = ErrorFactory(value => `Unsupported value for enum value: ${value}`); | ||
/** | ||
* | ||
* @class MissingModelError | ||
* @type {Error|Function} | ||
*/ | ||
export const MissingModelError = ErrorFactory('Model does not exist in collection. call add() to add a model to the index.'); | ||
/** | ||
* | ||
* @class ModelExistsError | ||
* @type {Error|Function} | ||
*/ | ||
export const ModelExistsError = ErrorFactory('Model already exists in collection index. call update() if you wish to update the model'); | ||
/** | ||
* | ||
* @class MissingFieldError | ||
* @type {Error|Function} | ||
*/ | ||
export const MissingFieldError = ErrorFactory(field => `Requested field ${field} does not exist on model`); |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.