New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

effector-react

Package Overview
Dependencies
Maintainers
2
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effector-react - npm Package Versions

1
15

22.1.0

Diff

Changelog

Source

effector-react 22.1.0

  • Added support for react 18 (PR #655)
  • Added useUnit method to read multiple stores and bind events or effects to scope in a single batched call (PR #733, #738)
import {value createEvent, value createStore, value fork} from 'effector'
import {value useUnit, value Provider} from 'effector-react/scope'

const inc = createEvent()
const $count = createStore(0)
const $title = createStore('useStore example')

$count.on(inc, x => x + 1)

const App = () => {
  const [count, title, incFn] = useUnit([$count, $title, inc])
  return (
    <>
      <h1>{title}</h1>
      <p>Count: {count}</p>
      <button onClick={() => incFn()}>increment</button>
    </>
  )
}

const scope = fork()

render(
  () => (
    <Provider value={scope}>
      <App />
    </Provider>
  ),
  document.getElementById('root'),
)
  • Added placeholder option to useList to render in cases of empty list
const ChatList = () => (
  <div>
    {useList($chats, {
      fn: chat => <div>Chat {chat.name}</div>,
      keys: [],
      placeholder: <div>You have no chats yet. Add first one?</div>,
    })}
  </div>
)
  • Added defaultValue option to useStoreMap to return in cases when fn returns undefined
const ChatName = ({id}) => {
  const chat = useStoreMap({
    store: $chats,
    keys: [id],
    fn: chats => chats.find(chat => chat.id === id),
    defaultValue: {id: 'default', name: 'Default chat'},
  })
  return <span>{chat.name}</span>
}
  • Fixed Gate.status store being serialized (PR #683)
drelliot
published 22.0.6 •

Changelog

Source

effector-react 22.0.6

  • Fix Can't perform a React state update on an unmounted component warning for useStoreMap in a few cases (issue #574)
drelliot
published 22.0.5 •

drelliot
published 22.0.4 •

drelliot
published 22.0.3 •

drelliot
published 22.0.2 •

drelliot
published 22.0.1 •

drelliot
published 22.0.0 •

Changelog

Source

effector 22.0.0

  • Add support for plain functions to attach: attach({source, async effect(source, params) {}})
  • Allow to use fork without domains: const scope = fork()
    • Unit not found in scope error is no longer exists, any unit could be used in any scope
    • Increase performance of fork and serialize a hundredfold
  • Add support for attached effects to fork handlers
  • Add support for tuples to fork values and handlers: fork({values: [[$user, 'alice'], [$age, 22]]})
  • Add serialize: 'ignore' option to createStore to declare store as ignored by serialize calls
  • Make onlyChanges: true a default serialize option
  • Fix babel plugin issue with parsing method calls (e.g. in react native)
  • Validate combine arguments and throw an error in case of undefined and non-store units (issue #509)
  • Throw an error when fork handlers or values got units without sid or with duplicate sid
  • Deprecate createStoreObject alias for combine
  • Deprecate effector/fork module
  • Deprecate .thru
  • Deprecate second argument in store.map
  • Deprecate direct manipulations with derived units:
    • Deprecate .on in derived stores created by store.map and combine
    • Deprecate calls of derived events created by event.map, event.filterMap and event.filter
    • Deprecate calls of fx.done, fx.doneData and other events belongs to effects
  • Remove ɔ (latin small letter open o) symbol to prevent incorrect unicode parsing
  • Remove undocumented scope.find which is a wrong abstraction for a new fork
  • Make Scope a unit:
    • Add support for Scope to is.unit
    • Add is.scope method
  • Allow to pass a scope to scopeBind: scopeBind(unit, {scope}), which is also can be used outside from .watch
  • Improve es modules support
  • Make package size 10% smaller
drelliot
published 21.3.3 •

drelliot
published 21.3.2 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc