Skip to content

Releases: teafuljs/teaful

0.8.0

14 Nov 10:26
1e98db5
Compare
Choose a tag to compare

What's changed

Breaking changes

  • One this breaking change for this version: Remove confusing reset feature #44

    Reset function is removed. It's not responsibility of the library. In this way:

    Pros:

    • Removing confusion as to what exactly the reset function did. Simplifying and making it easier to understand.
    • Fewer things in memory. Thus it is not necessary to save the store + initialStore. Only the store. This improves performance for applications with very large stores.
    • Tiniest. Supporting reset made it take up more bits.
    • Removing a feature that did not add value to the library, since the same could be done with the setter.
    • More flexibility to the user to reset with the setter where the user wants: last value, last value fetched to an API, initial value...

    Cons:

    • The user will be responsible for controlling the reset. That is, save the value in memory.

      Example:

      const [value, setValue] = useStore.value()
      const lastValue = useRef(value)
      
      // After some changes, is possible to reset with:
      setValue(lastValue.current)

      Another example:

       const initialStore = { count: 0 }
       export const { getStore } = createStore(initialStore)
       const [,setStore] = getStore()
      
       export const reset = () => setStore(initialStore)
       import { reset } from './store'
      
       function ResetStore() {
         return <button onClick={reset}>Reset store</button>
      }

Full Changelog: 0.7.2...0.8.0

0.8.0-canary.1

12 Nov 20:58
Compare
Choose a tag to compare
0.8.0-canary.1 Pre-release
Pre-release

0.7.2

08 Nov 13:23
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.7.1...0.7.2

0.7.1

08 Nov 09:57
11c6a82
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.7.0...0.7.1

0.7.0

05 Nov 19:49
Compare
Choose a tag to compare

Fragstore is renamed to Teaful

CHANGES

  • fix: update README.md #24 by @niexq
  • fix: eslint warning and remove dist added to eslintignore #27 by @niexq

BREAKING CHANGES

  • Change of name. Fragstore now is Teaful:
  • Convert onAfterUpdate to be more easy, tiny and powerful #22 by @aralroca
    • Inside the PR there are docs how to migrate from old to new version

0.6.0

01 Nov 19:03
9146fdc
Compare
Choose a tag to compare

0.6 release 🚀

We are taking advantage of the fact that we are in an early stage (0.x) to evolve quickly the library trying to make everything more and more tiny, easy and powerful.

Sorry for the breaking changes and if you have any questions you can write inside GitHub Discussions.

The library is becoming more and more stable and we will make less breaking changes, and from version 1.0 onwards we will follow the semantic version 100%.

🚨 I have to announce that after having changed the name of the library from fragmented-store to fragstore, we are forced to change it again to avoid problems with a company called fragstore that we didn't know about.

We have not changed the name for this version as it already has some breaking changes. But we will change it for the next version and it will be the only breaking change for the future 0.7 version.

We will make it so that when installing the latest fragstore package in npm it will make a warning saying so, but I prefer to announce it.

👉 Subscribe to this discussion to find out about the name change.

New features

Breaking changes

  • Remove Store component (now with getStore and callback change it no longer makes sense) #19 (by @aralroca)
  • Callbacks are unified (1 function instead of an object of functions) #19 (by @aralroca)

How to migrate

  1. Remove this component
<Store store={initialStore} callbacks={{ cart: onCartUpdate }}>
</Store>
  1. Use the store variable inside createStore:
const { useStore, getStore } = createStore(initialStore)
// Or if you need it to loading dynamically use the getStore helper:
const [, setStore] = getStore()
setStore(store => ({ ...store, ...initialStore }))
  1. Use a callback inside createStore:
const { useStore, getStore } = createStore(initialStore, onStoreUpdate)

function onStoreUpdate({ path, ...rest }) {
  if(path.startsWith('cart')) onCartUpdate(...rest)
}
// Or if you want the event to be cleared when the component unmounts, use useStore:
const [cart, setCart] = useStore.cart(initialCartValue, onCartUpdate)

0.6.0-canary.2

30 Oct 18:55
Compare
Choose a tag to compare
0.6.0-canary.2 Pre-release
Pre-release

0.6.0-canary.1

30 Oct 13:50
Compare
Choose a tag to compare
0.6.0-canary.1 Pre-release
Pre-release
  • Add getStore helper + withStore HoC. Change callback + remove Store + add docs + add tests #19

0.5.0

22 Oct 21:53
6b55c55
Compare
Choose a tag to compare

BREAKING CHANGES

  • We renamed Provider to Store because after the reimplementation it is no longer mandatory to use it because it is no longer a provider, it only makes sense to redefine the store and callbacks. In the future, it will surely have more features.

0.4.1

14 Oct 21:36
Compare
Choose a tag to compare