Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Releases: ryangjchandler/spruce

v2.0.0

13 Oct 10:12

Choose a tag to compare

Added

  • Added support for persisted stores. (#55)
Spruce.store('form', {
    name: 'Ryan'
}, persisted = true)

Persisted stores use local storage to save state between page loads. On load, it will retrieve the state from a local storage key __spruce:${name}.

When a persisted store is updated, it will push the changes to local storage under that same key by running the object through JSON.stringify().

Fixed

  • Fixed problem with watchers ending up in an infinite loop.

Removed

  • Removed all event bus related methods: Spruce.on(), Spruce.off(), Spruce.emit() and Spruce.once(). (#48)

v1.1.2

08 Oct 20:09

Choose a tag to compare

1.1.2

v1.1.1

02 Sep 17:49

Choose a tag to compare

Security

  • Bump bl from 4.0.2 to 4.0.3 (#52)

v1.1.0

27 Aug 10:14

Choose a tag to compare

Fixed

  • Spruce will now react to changes made to Array using mutable methods such as Array.push().

v1.0.0

26 Aug 13:36

Choose a tag to compare

🚨 This is a major version and will include some breaking changes.

Added

  • Added magic $store property using the "magic properties" API available in Alpine >= 2.5.0.

Removed

  • Removed the need for x-subscribe. (#44)
  • Removed the oldValue argument from Spruce.watch callbacks. Callbacks will now only receive the current/new value.

Changes

  • Spruce will only work with Alpine >= 2.5.0, so make sure to upgrade!

v0.6.1

15 Jun 16:30

Choose a tag to compare

v0.6.1 Pre-release
Pre-release

Fixed

  • module entry in package.json has been updated to correctly point to spruce.module.js distribution file (#35).

v0.6.0

25 May 18:44

Choose a tag to compare

v0.6.0 Pre-release
Pre-release

Added

  • Basic support for Turbolinks (#33).

v0.5.0

22 May 20:05

Choose a tag to compare

v0.5.0 Pre-release
Pre-release

Added

  • Spruce.reset() introduced to allow resetting / bulk updating state (#31)
  • Spruce.once() introduced to allow registering one-time event listeners (#32)

v0.4.0

09 May 16:59

Choose a tag to compare

v0.4.0 Pre-release
Pre-release

Added

  • Added a new Spruce.off() method. #29
  • Return a callback from Spruce.on() to un-hook listeners. #29

v0.3.0

03 May 19:45

Choose a tag to compare

v0.3.0 Pre-release
Pre-release

Added

  • New event bus! Exposes 2 new methods, Spruce.on() and Spruce.emit() (#21)
  • New Spruce.watch() method for registering watchers on store properties (#23)
  • Can now access stores externally using Spruce.store('storeName') (#25)