How to use the effector-react/ssr.useEvent 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 / serverless-ssr / src / app.tsx View on Github external
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}&gt;
          {userName}
        </button>
      
    )
  })
}
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>
      
    )