Skip to content
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

[TS] Context types #57

Closed
davidskuza opened this issue Jan 17, 2022 · 1 comment
Closed

[TS] Context types #57

davidskuza opened this issue Jan 17, 2022 · 1 comment
Labels

Comments

@davidskuza
Copy link

Hey, simple case, or as I thought.

https://codesandbox.io/s/sleepy-worker-s85bs

Simple interface for typed data, can't pass it to context. Is it how it's supposed to work?

@gajus
Copy link
Owner

gajus commented Jan 18, 2022

Looks more like a TypeScript question. I am not sure why type works, but interface does not in this case.

This works:

import roarr from "roarr";

type Custom = {
  a: string;
  b: string;
}

const logger = roarr.Roarr;

const data: Custom = {
  a: "asd",
  b: "asd"
};

logger.error(
  {
    data
  },
  "test"
);

@gajus gajus added the question label Jan 18, 2022
@gajus gajus closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants