-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Background
Currently, in templates, assemble and other base app, we have the convention of using isApp, isView and so on to identify the "instance type", so that plugins will only be used on certain instances.
Proposal
I propose that we implement one or two methods and associated properties here, in base-plugins, for checking instance "types". I think these methods belong here since "smart plugins" can't be used without this plugin, thus isApp or similar labels are useless otherwise.
Example
.is{Function}: Currently we use the.ismethod to add a type to an instance. I think this can stay the same, but we can also allow an array of strings to be passed, likeapp.is(['views', 'collection'])._is{Array}: we should add an._isarray for storing names passed to.is..isType{Function}: this method would take a string or array of strings and return true if an instance has any of the given strings on the._isarray. It would also return true forisType('app')when no other types are defined.
@doowb, anyone else, thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels