MCPcopy Create free account
hub / github.com/shoutem/ui / resolveVariable

Method resolveVariable

services/variableResolver.js:38–52  ·  view source on GitHub ↗
(...params)

Source from the content-addressed store, hash-verified

36 // resolveVariable(scope, variableName) -> Tries to get the variable under specific scope
37 // Variable name can be stringified object path or a regular string, i.e -> text.color
38 resolveVariable(...params) {
39 if (arguments.length === 1) {
40 const variablePath = _.split(params[0], '.');
41
42 return _.get(this.variables, variablePath);
43 }
44
45 if (arguments.length === 2) {
46 return this.getScopedVariable(params[0], params[1]);
47 }
48
49 throw new Error(
50 "Invalid theme variable resolution call. Please use full signature \n-> resolveVariable(scope, variableName),\n or the shorthand if you're getting a variable from shoutem.theme extension \n->resolveVariable(variableName)",
51 );
52 }
53
54 createScopedResolver(scope) {
55 return (...params) => {

Callers

nothing calls this directly

Calls 1

getScopedVariableMethod · 0.95

Tested by

no test coverage detected