Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Allow to pass external source for selection #13

Open
igorkamyshev opened this issue Nov 14, 2022 · 1 comment
Open

Allow to pass external source for selection #13

igorkamyshev opened this issue Nov 14, 2022 · 1 comment

Comments

@igorkamyshev
Copy link
Member

Now it's impossible to create selection with some external dynamic source, but it could be useful for cases like search 👇

const foundTodos = createSelection(
  todos,
  {
    source: $searchString,
    fn: (todo, searchString): todo is ActiveTodo => todo.title.includes(searchString)
  },
)
@Minhir
Copy link
Member

Minhir commented Nov 14, 2022

Looks like we need to have two fields source and clock to be consistent with sample. Also, there are two different cases:

  1. You want to update selection on each $searchString update
  2. You don't want to update selection on each $searchString update

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants