0.4.0 • Published 3 years ago

glyx v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

glyx

The declarative state management library. (In the works)

yarn add glyxnpm i glyx
const store = createStore(() => {
  const count = state(1)
  const expensive = derived(() => count.$ ** 10, [count])

  const increment = action(() => count.$ += 1)

  watch(() => {
    console.log(count.$)
  }, [count])

  return {count, expensive, increment}
})

store.increment()

store.getState() // {count: 2, expensive: 1024}

TODO

  • Basic proof of concept
  • Subscribers / listeners (done: basic use case)
  • Watchers - passing previous and new value
  • Comprehensive error handling, e.g. enforcing that the correct values are passed as dependencies. Includes TS support
  • First-class TS support
  • Exports for different frameworks, e.g. React, Vue, with specific APIs, like selectors
  • Comparison functions
  • Ready-to-use variants of declarations, like action.set to easily create a setter
  • ...

How to contribute

  • Use yarn test to run tests
0.4.0

3 years ago

0.3.0

3 years ago

0.1.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago