How to use the effector-react/ssr.useList function in effector-react

To help you get started, we’ve selected a few effector-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zerobias / effector / examples / react-ssr / src / app.tsx View on Github external
const Friends = () =&gt; useList(friends, friend =&gt; <li>{friend}</li>)
const Total = () =&gt; <small>Total: {useStore(friendsTotal)}</small>
github zerobias / effector / examples / react-ssr / src / app.tsx View on Github external
const UserList = () =&gt; {
  const selectUser = useEvent(selectUserEvent)
  return useList(userList, userName =&gt; {
    const isSelected = useStoreMap({
      store: user,
      keys: [userName],
      fn: (selected, [current]) =&gt; selected === current,
    })
    return (
      &lt;&gt;
        <br>
        <button> selectUser(users[userName])}
          disabled={isSelected}&gt;
          {userName}
        </button>
      
    )
  })
github zerobias / effector / examples / serverless-ssr / src / app.tsx View on Github external
const UserList = () =&gt; {
  const selectUser = useEvent(selectUserEvent)
  return useList(userList, userName =&gt; {
    const isSelected = useStoreMap({
      store: user,
      keys: [userName],
      fn: (selected, [current]) =&gt; selected === current,
    })
    return (
      &lt;&gt;
        <br>
        <button> selectUser(userName)} disabled={isSelected}&gt;
          {userName}
        </button>
      
    )
  })
}
export const App = ({root}) =&gt; (
github zerobias / effector / examples / serverless-ssr / src / app.tsx View on Github external
const Friends = () =&gt; useList(friends, friend =&gt; <li>{friend}</li>)
const Total = () =&gt; <small>Total: {useStore(friendsTotal)}</small>