Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const UserList = () => {
const selectUser = useEvent(selectUserEvent)
return useList(userList, userName => {
const isSelected = useStoreMap({
store: user,
keys: [userName],
fn: (selected, [current]) => selected === current,
})
return (
<>
<br>
<button> selectUser(userName)} disabled={isSelected}>
{userName}
</button>
)
})
}
const UserList = () => {
const selectUser = useEvent(selectUserEvent)
return useList(userList, userName => {
const isSelected = useStoreMap({
store: user,
keys: [userName],
fn: (selected, [current]) => selected === current,
})
return (
<>
<br>
<button> selectUser(users[userName])}
disabled={isSelected}>
{userName}
</button>
)