effector

Business logic with ease ☄️

MIT License

Downloads
370.3K
Stars
4.5K
Committers
151
effector - effector 22.8.0

Published by AlexandrHoroshih over 1 year ago

  • Sids are no longer required for fork({ values, handlers }), which allows to run tests without effector/babel-plugin. Note, that plugin and sids are still required for SSR. (PR #855)
effector -

Published by AlexandrHoroshih over 1 year ago

  • Fix Gate usage as component. <Gate /> will also be isomorphic by scope.
effector - effector 22.7.0

Published by AlexandrHoroshih over 1 year ago

  • Fix Declaration type, provide missing top-level properties for region and factory types
  • Add node's id to Declaration type
effector - effector 22.6.2

Published by igorkamyshev over 1 year ago

  • Fix return type of withRegion
effector - effector 22.6.1

Published by AlexandrHoroshih over 1 year ago

  • Add missing exports definition for effector/inspect API
effector - effector 22.6.0

Published by AlexandrHoroshih over 1 year ago

effector - effector 22.5.2

Published by sergeysova over 1 year ago

  • Fix serialize: ignore on createStore must not serialize, event fork({ values }) is used for the store (PR #862)
effector - effector 22.5.1

Published by zerobias over 1 year ago

  • Fix default factories list in babel-plugin (PR #857)
effector - effector-react 22.5.0

Published by zerobias over 1 year ago

  • Make useGate isomorphic in effector-react module, so the one not needed to use effector-react/scope anymore (PR #852)
  • Fix useUnit hangs when scope is changed (happens when route is changed in next.js) (PR #851)
effector - effector 22.5.0

Published by zerobias almost 2 years ago

effector - effector-solid 0.22.7

Published by igorkamyshev almost 2 years ago

effector - effector-react 22.4.0

Published by igorkamyshev almost 2 years ago

effector - effector 22.4.1

Published by zerobias almost 2 years ago

  • Add type support for read only arrays in sample source. This case now supported and typechecked correctly:
const profileFormSubmitted = createEvent()
const $name = createStore('alice')
const $age = createStore(0)
const saveProfileFx = createEffect(async ([name, age]: [string, number]) => {})

sample({
  clock: profileFormSubmitted,
  source: [$name, $age] as const,
  target: saveProfileFx,
})

Note that the one need to use "as const" in that case to got correct typechecking because without it typescript cannot infer the type [Store<string>, Store<number>]. We are working to avoid that limitation, stay tuned!

effector - effector Encke 22.4.0

Published by zerobias almost 2 years ago

  • Add custom serializers for Store (PR #744)
  • Allow to pass domain as an argument for createEvent and similar methods (PR #763)
  • Add $store.reinit event to reset store to default value (PR #797)

Before $store.reinit:

const $formValues = createStore<FormValues | null>(null);

sample({
 clock: [timeoutOut, buttonClicked, meteorHit],
 target: [
   saveAllStuffFx,
 ]
})

// here we would need to duplicate the same clocks 👎 
$formValues.reset([timeoutOut, buttonClicked, meteorHit])

With $store.reinit:

const $formValues = createStore<FormValues | null>(null);

sample({
 clock: [timeoutOut, buttonClicked, meteorHit],
 target: [
   saveAllStuffFx,
   // reset $formValues back to null due to one of the clock reasons
   $formValues.reinit,
   // no need to duplicate clocks list 👍 
 ]
})
  • Add safe mode for scopeBind (PR #688)
  • Add is.attached method to detect effects created via attach (PR #670)
  • Add @farfetched/core and atomic-router to default factories so the one not needed to describe them explicitly
  • Protect against combine argument being broken via Array.slice (PR #801)
  • Add "type" entry for package exports (PR #759)
  • Finally allow Gate to be serialized (as this requires changes in babel plugin) (PR #683)
effector - effector-react 22.3.4

Published by zerobias almost 2 years ago

  • Fixed useUnit skipping updates when used with useEffect and useGate
effector - effector-react 22.3.3

Published by zerobias about 2 years ago

  • Fix useUnit skipping updates during scope changes (often happens in next.js apps). Big thanks to @AlexandrHoroshih for investigation
effector - effector-react 22.3.1

Published by zerobias about 2 years ago

  • Fix useUnit skipping updates in react 16-17
effector - effector-vue 22.2.0

Published by igorkamyshev about 2 years ago

  • Add useStoreMap hook for Vue 3 composition API to select part from a store (PR #780 by @ilajosmanov)
effector - effector-react 22.3.0

Published by igorkamyshev about 2 years ago

  • Made hooks useEvent, useStore, useStoreMap and useList isomorphic, now they would use scope from the Provider if it is available and scope-less mode otherwise. For useUnit it was done in 22.2.0.
  • Added parameter forceScope to useEvent, useStore, useStoreMap and useList to force usage of scope from Provider, it would throw an error if Provider is not available, /scope module sets forceScope to true by default
effector - effector-solid 0.22.6

Published by igorkamyshev about 2 years ago

  • Add type of Provider to main module
Package Rankings
Top 1.08% on Npmjs.org
Top 14.96% on Deno.land
Badges
Extracted from project README
Tested with browserstack