github spaansba/ForesightJS V3.2.0

latest releases: V3.3.2, V3.3.1, V3.3.0...
3 months ago

V3.2.0 js.foresight

In this update we changed the lifecycle of an registered element. Nothing will change for most applications but it is nice to know.

Before:
Register callback hit unregister

Now:
Register callback hit isCallbackActive prop set to false wait for reactivateAfter ms (default infinitely) set isCallbackActive back to true Go back to callback hit step

With this new lifecycle it is now possible to refetch again after reactivateAfter ms, this is usefull for when you know your data that you prefetched earlier is stale. You can also programmatically reset isCallbackActive by calling ForesightManager.instance.reactivate().

Elements will still automatically be unregistered on DOM removal

Changes

  • ForesightManager.instance.unregister() is now a public API for unregistering elements
  • unregister() as return from ForesightManager.instance.register() has been deprecated

Features

  • added elementReactivatedEvent which emits after an element is reactivated (if isCallbackActive is true)
  • added callbackInfo to ForesightElementData with the following props for debugging purposes:
    • callbackFiredCount
    • lastCallbackInvokedAt
    • lastCallbackCompletedAt
    • lastCallbackRuntime
    • lastCallbackStatus
    • lastCallbackErrorMessage
    • reactivateAfter
    • isCallbackActive
    • isRunningCallback

V1.1.0 js.foresight-devtools

Features

  • Element tab now distinguishes between active/unactive elements
  • Element tab shows countdown of when the callback will be reactivated by setting isCallbackActive to true. Which is reactivateAfter ms after the callback is completed not invoked.
  • Element tab allows you to unregister an element by clicking the trash icon
  • Log tab now has the elementReactivatedEvent
  • Both the json in the logs and element tab now show the full callbackInfo from ForesightElementData

All updates can be viewed in the Playground

Don't miss a new ForesightJS release

NewReleases is sending notifications on new releases.