Skip to content

Commit d0f9290

Browse files
committed
docs: remove references to tracker reactivity
1 parent c1d4bc3 commit d0f9290

File tree

3 files changed

+85
-87
lines changed

3 files changed

+85
-87
lines changed

README.md

Lines changed: 83 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -26,80 +26,81 @@ There are also reasons not to choose this package. Because of all it does, this
2626
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
2727
**Table of Contents**
2828

29-
- [Installation](#installation)
30-
- [Lingo](#lingo)
31-
- [The History of SimpleSchema](#the-history-of-simpleschema)
32-
- [Quick Start](#quick-start)
33-
- [Validate an Object and Throw an Error](#validate-an-object-and-throw-an-error)
34-
- [Validate an Array of Objects and Throw an Error](#validate-an-array-of-objects-and-throw-an-error)
35-
- [Validate an Object and Get the Errors](#validate-an-object-and-get-the-errors)
36-
- [Validate a MongoDB Update Document](#validate-a-mongodb-update-document)
37-
- [Automatically Clean the Object Before Validating It](#automatically-clean-the-object-before-validating-it)
38-
- [Set Default Options for One Schema](#set-default-options-for-one-schema)
39-
- [Set Default Options for All Schemas](#set-default-options-for-all-schemas)
40-
- [Explicitly Clean an Object](#explicitly-clean-an-object)
41-
- [Defining a Schema](#defining-a-schema)
42-
- [Shorthand Definitions](#shorthand-definitions)
43-
- [Longhand Definitions](#longhand-definitions)
44-
- [Mixing Shorthand with Longhand](#mixing-shorthand-with-longhand)
45-
- [More Shorthand](#more-shorthand)
46-
- [Multiple Definitions For One Key](#multiple-definitions-for-one-key)
47-
- [Extending Schemas](#extending-schemas)
48-
- [Overriding When Extending](#overriding-when-extending)
49-
- [Subschemas](#subschemas)
50-
- [Extracting Schemas](#extracting-schemas)
51-
- [Raw Definition](#raw-definition)
52-
- [Schema Keys](#schema-keys)
53-
- [Schema Rules](#schema-rules)
54-
- [type](#type)
55-
- [label](#label)
56-
- [optional](#optional)
57-
- [required](#required)
58-
- [min/max](#minmax)
59-
- [exclusiveMin/exclusiveMax](#exclusiveminexclusivemax)
60-
- [minCount/maxCount](#mincountmaxcount)
61-
- [allowedValues](#allowedvalues)
62-
- [regEx](#regex)
63-
- [skipRegExCheckForEmptyStrings](#skipregexcheckforemptystrings)
64-
- [blackbox](#blackbox)
65-
- [trim](#trim)
66-
- [custom](#custom)
67-
- [defaultValue](#defaultvalue)
68-
- [autoValue](#autovalue)
69-
- [autoValue gotchas](#autovalue-gotchas)
70-
- [Function Properties](#function-properties)
71-
- [Getting field properties](#getting-field-properties)
72-
- [Validating Data](#validating-data)
73-
- [The Object to Validate](#the-object-to-validate)
74-
- [Ways to Perform Validation](#ways-to-perform-validation)
75-
- [Named Validation Contexts](#named-validation-contexts)
76-
- [Unnamed Validation Contexts](#unnamed-validation-contexts)
77-
- [Validating an Object](#validating-an-object)
78-
- [Validating Only Some Keys in an Object](#validating-only-some-keys-in-an-object)
79-
- [Validation Options](#validation-options)
80-
- [Validating and Throwing ValidationErrors](#validating-and-throwing-validationerrors)
81-
- [Customize the Error That is Thrown](#customize-the-error-that-is-thrown)
82-
- [Custom Field Validation](#custom-field-validation)
83-
- [Custom Whole-Document Validators](#custom-whole-document-validators)
84-
- [Manually Adding a Validation Error](#manually-adding-a-validation-error)
85-
- [Getting a List of Invalid Keys and Validation Error Messages](#getting-a-list-of-invalid-keys-and-validation-error-messages)
86-
- [Customizing Validation Messages](#customizing-validation-messages)
87-
- [Other Validation Context Methods](#other-validation-context-methods)
88-
- [Other SimpleSchema Methods](#other-simpleschema-methods)
89-
- [Cleaning Objects](#cleaning-objects)
90-
- [Dates](#dates)
91-
- [Best Practice Code Examples](#best-practice-code-examples)
92-
- [Make a field conditionally required](#make-a-field-conditionally-required)
93-
- [Validate one key against another](#validate-one-key-against-another)
94-
- [Debug Mode](#debug-mode)
95-
- [Extending the Schema Options](#extending-the-schema-options)
96-
- [Converting a SimpleSchema to a JSONSchema](#converting-a-simpleschema-to-a-jsonschema)
97-
- [Add On Packages](#add-on-packages)
98-
- [Contributors](#contributors)
99-
- [Sponsors](#sponsors)
100-
- [License](#license)
101-
- [Contributing](#contributing)
102-
- [Thanks](#thanks)
29+
- [SimpleSchema (simpl-schema NPM package)](#simpleschema-simpl-schema-npm-package)
30+
- [Installation](#installation)
31+
- [Lingo](#lingo)
32+
- [The History of SimpleSchema](#the-history-of-simpleschema)
33+
- [Quick Start](#quick-start)
34+
- [Validate an Object and Throw an Error](#validate-an-object-and-throw-an-error)
35+
- [Validate an Array of Objects and Throw an Error](#validate-an-array-of-objects-and-throw-an-error)
36+
- [Validate an Object and Get the Errors](#validate-an-object-and-get-the-errors)
37+
- [Validate a MongoDB Update Document](#validate-a-mongodb-update-document)
38+
- [Automatically Clean the Object Before Validating It](#automatically-clean-the-object-before-validating-it)
39+
- [Set Default Options for One Schema](#set-default-options-for-one-schema)
40+
- [Set Default Options for All Schemas](#set-default-options-for-all-schemas)
41+
- [Explicitly Clean an Object](#explicitly-clean-an-object)
42+
- [Defining a Schema](#defining-a-schema)
43+
- [Shorthand Definitions](#shorthand-definitions)
44+
- [Longhand Definitions](#longhand-definitions)
45+
- [Mixing Shorthand with Longhand](#mixing-shorthand-with-longhand)
46+
- [More Shorthand](#more-shorthand)
47+
- [Multiple Definitions For One Key](#multiple-definitions-for-one-key)
48+
- [Extending Schemas](#extending-schemas)
49+
- [Overriding When Extending](#overriding-when-extending)
50+
- [Subschemas](#subschemas)
51+
- [Extracting Schemas](#extracting-schemas)
52+
- [Raw Definition](#raw-definition)
53+
- [Schema Keys](#schema-keys)
54+
- [Schema Rules](#schema-rules)
55+
- [type](#type)
56+
- [label](#label)
57+
- [optional](#optional)
58+
- [required](#required)
59+
- [min/max](#minmax)
60+
- [exclusiveMin/exclusiveMax](#exclusiveminexclusivemax)
61+
- [minCount/maxCount](#mincountmaxcount)
62+
- [allowedValues](#allowedvalues)
63+
- [regEx](#regex)
64+
- [skipRegExCheckForEmptyStrings](#skipregexcheckforemptystrings)
65+
- [blackbox](#blackbox)
66+
- [trim](#trim)
67+
- [custom](#custom)
68+
- [defaultValue](#defaultvalue)
69+
- [autoValue](#autovalue)
70+
- [autoValue gotchas](#autovalue-gotchas)
71+
- [Function Properties](#function-properties)
72+
- [Getting field properties](#getting-field-properties)
73+
- [Validating Data](#validating-data)
74+
- [The Object to Validate](#the-object-to-validate)
75+
- [Ways to Perform Validation](#ways-to-perform-validation)
76+
- [Named Validation Contexts](#named-validation-contexts)
77+
- [Unnamed Validation Contexts](#unnamed-validation-contexts)
78+
- [Validating an Object](#validating-an-object)
79+
- [Validating Only Some Keys in an Object](#validating-only-some-keys-in-an-object)
80+
- [Validation Options](#validation-options)
81+
- [Validating and Throwing ValidationErrors](#validating-and-throwing-validationerrors)
82+
- [Customize the Error That is Thrown](#customize-the-error-that-is-thrown)
83+
- [Custom Field Validation](#custom-field-validation)
84+
- [Custom Whole-Document Validators](#custom-whole-document-validators)
85+
- [Manually Adding a Validation Error](#manually-adding-a-validation-error)
86+
- [Getting a List of Invalid Keys and Validation Error Messages](#getting-a-list-of-invalid-keys-and-validation-error-messages)
87+
- [Customizing Validation Messages](#customizing-validation-messages)
88+
- [Other Validation Context Methods](#other-validation-context-methods)
89+
- [Other SimpleSchema Methods](#other-simpleschema-methods)
90+
- [Cleaning Objects](#cleaning-objects)
91+
- [Dates](#dates)
92+
- [Best Practice Code Examples](#best-practice-code-examples)
93+
- [Make a field conditionally required](#make-a-field-conditionally-required)
94+
- [Validate one key against another](#validate-one-key-against-another)
95+
- [Debug Mode](#debug-mode)
96+
- [Extending the Schema Options](#extending-the-schema-options)
97+
- [Converting a SimpleSchema to a JSONSchema](#converting-a-simpleschema-to-a-jsonschema)
98+
- [Add On Packages](#add-on-packages)
99+
- [Contributors](#contributors)
100+
- [Sponsors](#sponsors)
101+
- [License](#license)
102+
- [Contributing](#contributing)
103+
- [Thanks](#thanks)
103104

104105
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
105106

@@ -856,11 +857,11 @@ There are three ways to validate an object against your schema:
856857
1. With a unique named validation context, not throwing any Errors (schema.namedContext('someUniqueString').validate())
857858
1. With the default validation context, not throwing any Errors. (schema.namedContext().validate())
858859

859-
A validation context provides reactive methods for validating and checking the validation status of a particular object.
860+
A validation context provides methods for validating and checking the validation status of a particular object.
860861

861862
#### Named Validation Contexts
862863

863-
It's usually best to use a named validation context. That way, the context is automatically persisted by name, allowing you to easily rely on its reactive methods.
864+
It's usually best to use a named validation context. That way, the context is automatically persisted by name, allowing you to easily rely on its methods.
864865

865866
Here is an example of obtaining a named validation context:
866867

@@ -890,19 +891,19 @@ const schema = new SimpleSchema({
890891
const myValidationContext = schema.newContext();
891892
```
892893

893-
An unnamed validation context is not persisted anywhere. It can be useful when you need to see if a document is valid but you don't need any of the reactive methods for that context, or if you are going to keep the context reference in memory yourself.
894+
An unnamed validation context is not persisted anywhere. It can be useful when you need to see if a document is valid but you don't need any of the methods for that context, or if you are going to keep the context reference in memory yourself.
894895

895896
### Validating an Object
896897

897898
To validate an object against the schema in a validation context, call `validationContextInstance.validate(obj, options)`. This method returns `true` if the object is valid according to the schema or `false` if it is not. It also stores a list of invalid fields and corresponding error messages in the context object.
898899

899-
You can call `myContext.isValid()` to see if the object last passed into `validate()` was found to be valid. This is a reactive method that returns `true` or `false`.
900+
You can call `myContext.isValid()` to see if the object last passed into `validate()` was found to be valid. Returns `true` or `false`.
900901

901902
For a list of options, see the [Validation Options](#validation-options) section.
902903

903904
### Validating Only Some Keys in an Object
904905

905-
You may have the need to (re)validate certain keys while leaving any errors for other keys unchanged. For example, if you have several errors on a form and you want to revalidate only the invalid field the user is currently typing in. For this situation, call `myContext.validate` with the `keys` option set to an array of keys that should be validated. This may cause all of the reactive methods to react.
906+
You may have the need to (re)validate certain keys while leaving any errors for other keys unchanged. For example, if you have several errors on a form and you want to revalidate only the invalid field the user is currently typing in. For this situation, call `myContext.validate` with the `keys` option set to an array of keys that should be validated.
906907

907908
This method returns `true` only if all the specified schema keys and their descendent keys are valid according to the schema. Otherwise it returns `false`.
908909

@@ -1043,7 +1044,7 @@ Whole-document validators have the following available on `this` context:
10431044

10441045
### Manually Adding a Validation Error
10451046

1046-
If you want to reactively display an arbitrary validation error and it is not possible to use a custom validation function (perhaps you have to call a function `onSubmit` or wait for asynchronous results), you can add one or more errors to a validation context at any time by calling `myContext.addValidationErrors(errors)`, where `errors` is an array of error objects with the following format:
1047+
If you want to display an arbitrary validation error and it is not possible to use a custom validation function (perhaps you have to call a function `onSubmit` or wait for asynchronous results), you can add one or more errors to a validation context at any time by calling `myContext.addValidationErrors(errors)`, where `errors` is an array of error objects with the following format:
10471048

10481049
```js
10491050
{name: key, type: errorType, value: anyValue}
@@ -1065,8 +1066,6 @@ myValidationContext.addValidationErrors([
10651066

10661067
### Getting a List of Invalid Keys and Validation Error Messages
10671068

1068-
_This is a reactive method if you have enabled Tracker reactivity._
1069-
10701069
Call `myValidationContext.validationErrors()` to get the full array of validation errors. Each object in the array has at least two keys:
10711070

10721071
- `name`: The schema key as specified in the schema.
@@ -1107,11 +1106,10 @@ A `getErrorMessage` function in schema options will be tried before a global `ge
11071106
## Other Validation Context Methods
11081107

11091108
`myContext.keyIsInvalid(key)` returns true if the specified key is currently
1110-
invalid, or false if it is valid. This is a reactive method.
1109+
invalid, or false if it is valid.
11111110

11121111
`myContext.keyErrorMessage(key)` returns the error message for the specified
1113-
key if it is invalid. If it is valid, this method returns an empty string. This
1114-
is a reactive method.
1112+
key if it is invalid. If it is valid, this method returns an empty string.
11151113

11161114
Call `myContext.reset()` if you need to reset the validation context, clearing out any invalid field messages and making it valid.
11171115

src/SimpleSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ class SimpleSchema {
933933
}
934934

935935
/**
936-
* Gets a field's label or all field labels reactively.
936+
* Gets a field's label or all field labels
937937
*
938938
* @param key The schema key, specific or generic.
939939
* Omit this argument to get a dictionary of all labels.

src/ValidationContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default class ValidationContext {
7373
}
7474

7575
/**
76-
* Validates the object against the SimpleSchema and sets a reactive array of error objects
76+
* Validates the object against the SimpleSchema and sets an array of error objects
7777
* @param obj Object to be validated
7878
* @param options Validation options
7979
* @returns True if valid; otherwise false

0 commit comments

Comments
 (0)