mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-16 16:51:02 +02:00
Slightly tweak the config decode so that components can over-ride the
'with' method which injects parameters.
This commit is contained in:
parent
fc0af2f900
commit
76a3417b56
1 changed files with 6 additions and 4 deletions
|
|
@ -3,9 +3,7 @@ local components = import "components.jsonnet";
|
|||
|
||||
local apply = function(p, components)
|
||||
|
||||
local component = components[p.name];
|
||||
|
||||
(component + {
|
||||
local base = {
|
||||
|
||||
with:: function(k, v) self + {
|
||||
[k]:: v
|
||||
|
|
@ -18,7 +16,11 @@ local apply = function(p, components)
|
|||
self
|
||||
),
|
||||
|
||||
}).with_params(p.parameters);
|
||||
};
|
||||
|
||||
local component = base + components[p.name];
|
||||
|
||||
component.with_params(p.parameters);
|
||||
|
||||
local decode = function(config)
|
||||
local add = function(state, c) state + apply(c, components);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue