Skip to content

Latest commit

 

History

History
251 lines (150 loc) · 7.76 KB

CHANGELOG.md

File metadata and controls

251 lines (150 loc) · 7.76 KB

Changelog

v3.4

v3.4.5 08.09.2022

  • added unwatch

v3.4.4 25.08.2022

  • improve Cache types

v3.4.3 31.03.2022

  • fixed Circular dependency

v3.4.2 30.03.2022

  • added createEvent and onDestroy utils
  • deprecated onDestroy of Watch and Cache, use onClear
  • added new tests and jsDoc comments
  • refactor structure

v3.4.1 07.01.2022

  • added size field of Cache which returns count of subscribers

v3.4.0 07.08.2021

  • fixed bug of deep event using, in watcher and during another event
  • fixed types of scope, added Scope type
  • removed all default exports

v3.3

v3.3.3 10.07.2021

  • fixed bug of globalEvent

v3.3.2 10.07.2021

  • added scope export

v3.3.1 10.07.2021

  • updated readme

v3.3.0 10.07.2021

Stable version

  • normalized watchers running flow
  • fixed deep bugs
  • added globalEvent
  • unfortunately, the performance has decreased, but the current version is strong stable and still, this is one of the fastest solutions.

v3.2

v3.2.3 07.07.2021

  • fixed deep unwatched cache updating bag
const state = new State(0)
const cache1 = new Cache(() => state.value)
const cache2 = new Cache(() => cache1.value)

console.log(cache2.value) //0

state.value = 1

console.log(cache2.value) //1 (before: 0)

v3.2.2 07.07.2021

  • fixed infinite loop bug when you change that value you watch
const count = new State(0)

new Watch(() => {
  if (count.value < 2) {
    console.log(count.value++)
  }
})
// now you have `1` and `0` in console, before it was infinite loop

v3.2.1 07.07.2021

  • fixed readme icons

v3.2.0 07.07.2021

  • fixed bug when you change and ask cache value inside an event
const event = new Event()
const state = new State(1)
const cache = new Cache(() => state.value)

console.log(cache.value)
// 1

event.start()

state.value = 2

console.log(cache.value)
// 2 (before: 1)

event.end()

Now watch-state faster than redux in complex case

v3.1

v3.1.4 26.06.2021

  • fixed misprint bug of previous release

v3.1.3 26.06.2021

  • improved using of events inside a watcher

v3.1.2 26.06.2021

  • fixed a bug relates to the previous release

v3.1.1 26.06.2021

  • fixed a bug relates to the previous release

v3.1.0 26.06.2021

  • now events ignore watching, so you can use them inside watchers.

v3.0

v3.0.5 26.06.2021

  • fixed empty event running bug

v3.0.4 14.06.2021

  • fixed circular dependency bug

v3.0.3 07.06.2021

  • fixed a bug of importing

v3.0.2 07.06.2021

  • removed baseUrl using

v3.0.1 01.06.2021

  • updated readme

v3.0.0 30.05.2021

Now, update method of Cache do not update it immediately, only if you use cache value inside a watcher.

v2.0

To migrate from the first version please:

  • update to 2.0.0-migration
  • fix all errors in the browser console or fix all deprecated functionality
  • update to the second version

v2.0.2 17.03.2021

  • reduced code

v2.0.1 15.01.2021

  • removed cache decorator using with methods

v2.0.0 10.01.2021

  • removed deprecated code

v1.2

v1.2.0 10.01.2021

  • reduced code
  • deprecated mixer
  • added getState and getCache

v1.1

v1.1.1 02.01.2021

  • fixed a bug when a state in a cache in a watcher in a watcher which uses the state.
const log = []
const state = new State(1)
const cache = new Cache(() => state.value + 1)

new Watch(() => {
  if (state.value) {
    new Watch(() => log.push(cache.value))
  }
})
expect(log).toEqual([2])

state.value = 0
expect(log).toEqual([2]) // was [2, 1]

v1.1.0 12.12.2020

  • added getDecor and getDecors
  • deprecated stateValues

v1.0

v1.0.4 24.11.2020

  • fixed loop bug
  • fixed mixer bugs

v1.0.3 23.11.2020

  • removed watching in event

v1.0.2 21.11.2020

  • fixed an exception error
  • small improvements

v1.0.1 19.11.2020

  • fixed cache in cache bug

v1.0.0 17.11.2020