Global attributes resolution handler.
Hooks into a Template instance's lifecycle using
onCreated
to register a reactive var that holds all element attributes.
Hooks into onDestroyed
to dispose automatically.
Usually you don't have to manage this on your own.
- Source:
Methods
(static) create(instance, state)
Creates a new observer for attribute and state changes
for a given instance and updates attributes accordingly.
You usually don't need to run this manually,
because instances are automatically registered for this
method.
Parameters:
Name | Type | Description |
---|---|---|
instance |
Blaze.TemplateInstance | |
state |
ReactiveDict |
- Source:
(static) destroy(instance)
Cleanup fn to be run when the instance is destroyed.
You usually don't need to run this manually,
because instances are automatically registered for this
method.
Parameters:
Name | Type | Description |
---|---|---|
instance |
Blaze.TemplateInstance |
- Source:
(static) filter(name, fn)
Registers a list of props to filter out, before passing them
on to the resolver function.
This is esepcially useful, if you use tools that inject
data on a global level into templates.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | null | name of the component, needs to be registered. Set to null for global filter. |
fn |
function | null | function to filter props by name, array filter callback: |
- Source:
Example
// ignore all attributes from FlowRouter
BlazeUI.attributes().filter({ name: null, fn: n => n !== 'params' && n !== 'queryParams' })
(static) register(component)
Registers a given component for attribute resolving
Parameters:
Name | Type | Description |
---|---|---|
component |
UIComponent |
- Source: