mhoeger / create-function-app

Future "create-function-app" like code
8 stars 2 forks source link

Remove "new" keyword? #8

Open mhoeger opened 5 years ago

mhoeger commented 5 years ago

For main objects:

const app = new FunctionApp();

export const helloFunction = new AzureFunction("HelloFunction", sayHello);

vs.

const app = functionApp();

export const helloFunction = azureFunction("HelloFunction", sayHello);

For config-type settings

app.onTrigger(new HttpTrigger("api/bye", ["GET"]), goodbyeFunction);

vs.

const httpOptions: HttpOptions {
    route: "api/bye",
    method: ["GET"]
};

app.onTrigger(httpOptions, goodbyeFunction);

vs.

app.onTrigger(httpTrigger("api/bye", ["GET"]), goodbyeFunction);

Relevant issue... statefulness vs persistence: https://github.com/mhoeger/create-function-app/issues/5