Allowing custom properties
See original GitHub issueWhat do you think of allowing custom properties to let other packages have the possibility to enhance the Simple Schema with additional information? As an example:
var schema = new SimpleSchema({
'image' : {
'type' : String,
'otherPackage' : {
'animated' : true
}
}
});
I’d also be okay with only one property called “custom” or something where one can define such informations.
Issue Analytics
- State:
- Created 10 years ago
- Comments:10
Top Results From Across the Web
Using CSS custom properties (variables) - MDN Web Docs
Custom properties allow a value to be stored in one place, then referenced in multiple other places. An additional benefit is semantic ...
Read more >A Complete Guide to Custom Properties | CSS-Tricks
Custom property fallbacks ... The var() function is what allows for fallback values in custom properties. Here we're setting a scale() transform ...
Read more >Custom Properties — Tiled 1.9.2 documentation
Custom Properties . One of the major strengths of Tiled is that it allows setting custom properties on all of its basic data...
Read more >A Strategy Guide To CSS Custom Properties
Manipulating Color With Custom Properties # These allow us to specify individual components of a color such as the hue or lightness. Custom...
Read more >Adding Associative Dimensions Into Custom Properties - 2013
Open the part and display the dimensions to add to Custom Properties. Under Property Name, type a name or choose one from the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good question. A few points:
SimpleSchema.extendOptions
andmySimpleSchema.validator
. These are undocumented, but collection2 uses them to addunique
,autoValue
,denyInsert
, anddenyUpdate
(and the upcomingindex
option). Note thatvalidator
adds a custom validator to theSimpleSchema
instance rather than to all. This is necessary for one of the validations that collection2 does, but in general maybe there should be aSimpleSchema.addValidator
orSimpleSchema.addKeyValidator
that adds support to all SS instances. I think this is what you’re asking for.custom
option that takes a function or array of functions. The functions would return eithertrue
or an error type string (same as howmySimpleSchema.validator
works now, but user-definable per field).You can keep this open as a reminder to make these changes.
Great, thanks. I’ll dive right in.