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

Bug with types in source in spread operator #234

Open
Tracked by #175
mindyourlifeguide opened this issue Aug 29, 2022 · 0 comments
Open
Tracked by #175

Bug with types in source in spread operator #234

mindyourlifeguide opened this issue Aug 29, 2022 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@mindyourlifeguide
Copy link

mindyourlifeguide commented Aug 29, 2022

reproduce

type Events = {
  first_event: 'first_event',
  second_event: 'second_event',
}

type Pages = {
  first_page: 'first_page',
  second_page: 'second_page',
}

const $pages = createStore<Pages | null>(null);
const $events = createStore<Events | null>(null);
const $isClientStarted = createStore(false);

const clientStartEv = createEvent<{ events: Events; pages: Pages }>();

spread({
  source: clientStartEv,
  targets: { events: $events, pages: $pages }
});
No overload matches this call.
  Overload 1 of 2, '(config: { targets: { events?: Unit<Events | null> | undefined; pages?: Unit<Pages | null> | undefined; }; }): Event<Partial<{ events: Events | null; pages: Pages | null; }>>', gave the following error.
    Argument of type '{ source: Event<{ events: Events; pages: Pages; }>; targets: { events: Store<Events | null>; pages: Store<Pages | null>; }; }' is not assignable to parameter of type '{ targets: { events?: Unit<Events | null> | undefined; pages?: Unit<Pages | null> | undefined; }; }'.
      Object literal may only specify known properties, and 'source' does not exist in type '{ targets: { events?: Unit<Events | null> | undefined; pages?: Unit<Pages | null> | undefined; }; }'.
@sergeysova sergeysova added the bug Something isn't working label Aug 30, 2022
@sergeysova sergeysova added this to the v2.0 milestone Aug 30, 2022
@sergeysova sergeysova mentioned this issue Aug 30, 2022
35 tasks
@sergeysova sergeysova changed the title Bug with types in source in spread Bug with types in source in spread operator Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants