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

effector

Package Overview
Dependencies
Maintainers
2
Versions
273
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effector - npm Package Versions

1
28

21.8.6

Diff

drelliot
published 21.8.5 •

drelliot
published 21.8.4 •

drelliot
published 21.8.3 •

drelliot
published 21.8.2 •

drelliot
published 21.8.1 •

drelliot
published 21.8.0 •

Changelog

Source

effector 21.8.0

  • Add type support for arrays in sample target (PR #284, #445)
sample({
  clock: clickValidate,
  source: $formFields,
  target: [validateForm, sendStatsFx],
})
  • Add support for case functions, case stores and matcher stores to split. Case functions and stores will choose target case by its name, matcher stores are boolean stores which indicate whether to choose given case
const source = createEvent()
const even = createEvent()

const $odd = createStore(0)

split({
  source,
  // case function
  match(n) {
    if (n % 2 === 0) return 'even'
    return 'odd'
  },
  cases: {
    even,
    odd: $odd,
  },
})

const $currentPage = createStore('dashboard')

split({
  source,
  // case store
  match: $currentPage,
  cases: {
    dashboard: even,
    __: odd,
  },
})

const tryUpdatePage = createEvent()
const updatePageFx = createEffect()

const $hasWriteAccess = createStore(false)

split({
  source: tryUpdatePage,
  match: {
    // matcher store
    admin: $hasWriteAccess,
  },
  cases: {
    admin: updatePageFx,
  },
})
  • Add updateFilter config field to createStore to skip arbitrary store updates (discussion #428)
const $playerPosition = createStore(
  {x: 0, y: 0},
  {
    updateFilter: (update, current) => update.x !== current.x,
  },
)
  • Add support for sample with clock without source. For example, it useful in cases when clock is array of units and no source stores is needed
sample({
  clock: [fx1.doneData, fx2.doneData],
  fn: data => ({url: '/stats', data})
  target: fetchFx,
})
  • Add support for clock to guard to improve developer expirience in cases when update trigger (clock field) and data source (source field) are different things
guard({
  clock: validateForm,
  source: $formFields,
  filter: formFields => validator(formFields),
  target: submitFormFx,
})
  • Add addNames field to babel plugin (PR #450)

  • Add type support for Scope to clearNode (issue #441)

  • Add compositeName to Domain typings, making it consistent with other units

  • Add EventPayload and UnitValue type helpers (PR #434)

  • Improve various edge cases with fork api and serialization

  • Improve typechecking for attach (issue #439)

  • Fix various type issues in sample and guard typings

drelliot
published 21.7.5 •

drelliot
published 21.7.4 •

drelliot
published 21.7.3 •

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