Skip to content

Remove the ServiceApi and ObjectApi abstractions #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

igalshilman
Copy link
Contributor

This commit removes the previously introduced ServiceApi and ObjectApi types. With this commit applied, we no longer need a special concept, but simply import the typeof the Service/Object.

a.ts:

const greeter = restate.service("greeter", {
  greet: async (ctx: restate.Context, name: string) => {
    return message;
  },

});

export type GreeterService = typeof greeter;

b.ts

import type {GreeterService} from 'a.ts';
...
const Greeter: GreeterService = { path: "greeter" };
ctx.service(Greeter).greet("hello");
...

This commit removes the previously introduced ServiceApi and
ObjectApi types. With this commit applied, we no longer need
a special conncept, but simply import the typeof the Service/Object
@igalshilman igalshilman merged commit 485c53d into restatedev:main Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant