Skip to content

Non-reactive operations within reactive chain of operations #1507

Closed Answered by yuichirowada
yuichirowada asked this question in Q&A
Discussion options

You must be logged in to vote

Resolved. Basically, removing the call to clicked() in the function passed to Generators.observe made it work as I intended.

const data = [
    { id: 1, category: 1 },
    { id: 2, category: 1 },
    { id: 3, category: 1 },
    { id: 4, category: 2 },
    { id: 5, category: 2 }
];

const selectedCategory = view(Inputs.select(data.map(d => d.category), { unique: true }))
const selectedData = view(Inputs.table(data.filter(d => selectedCategory === d.category), { rows: 5 }));
<button id="click-me">Update the table below</button>
const btn = document.getElementById('click-me');
const data2 = [
    { id: 1, category: 1 },
    { id: 2, category: 1 },
    { id: 3, category: 1 },
    { id: 4, cat…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Fil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant