Skip to content

Commit

Permalink
fix: 🐛 fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Feb 11, 2020
1 parent 568b199 commit 8550b8a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/plugins/expressions/common/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export class Executor<Context extends Record<string, unknown> = Record<string, u
this.state.transitions.addFunction(fn);
}

public getFunction(name: string): ExpressionFunction | undefined {
return this.state.get().functions[name];
}

public getFunctions(): Record<string, ExpressionFunction> {
return { ...this.state.get().functions };
}
Expand All @@ -125,6 +129,10 @@ export class Executor<Context extends Record<string, unknown> = Record<string, u
this.state.transitions.addType(type);
}

public getType(name: string): ExpressionType | undefined {
return this.state.get().types[name];
}

public getTypes(): Record<string, ExpressionType> {
return { ...this.state.get().types };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,21 @@ export class ExpressionsService {
public setup() {
const { executor, renderers, registerFunction, run } = this;

const getFunction = executor.getFunction.bind(executor);
const getFunctions = executor.getFunctions.bind(executor);
const getRenderer = renderers.get.bind(renderers);
const getRenderers = renderers.toJS.bind(renderers);
const getType = executor.getType.bind(executor);
const getTypes = executor.getTypes.bind(executor);
const registerRenderer = renderers.register.bind(renderers);
const registerType = executor.registerType.bind(executor);

return {
getFunction,
getFunctions,
getRenderer,
getRenderers,
getType,
getTypes,
registerFunction,
registerRenderer,
Expand All @@ -142,15 +146,19 @@ export class ExpressionsService {
public start() {
const { executor, renderers, run } = this;

const getFunction = executor.getFunction.bind(executor);
const getFunctions = executor.getFunctions.bind(executor);
const getRenderer = renderers.get.bind(renderers);
const getRenderers = renderers.toJS.bind(renderers);
const getType = executor.getType.bind(executor);
const getTypes = executor.getTypes.bind(executor);

return {
getFunction,
getFunctions,
getRenderer,
getRenderers,
getType,
getTypes,
run,
};
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/expressions/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class ExpressionsPublicPlugin
// function that matches its definition, but which simply
// calls the server-side function endpoint.
Object.keys(serverFunctionList).forEach(functionName => {
if (functions.get(functionName)) {
if (expressionsSetup.getFunction(functionName)) {
return;
}
const fn = () => ({
Expand Down

0 comments on commit 8550b8a

Please sign in to comment.