Skip to content
Ben Lau edited this page Apr 16, 2017 · 10 revisions

v1.1

New Features

  1. Support Non-singleton dispatcher.

  2. Middleware - a mechanism to extend the functionality of dispatcher allowing for advanced asynchronous workflow and integration with visual component like FileDialog.

  3. Store - A replacement of AppListener that could listen from non-singleton dispatcher, and re-dispatch the action message to another Store components sequentially. It could avoid the over-complicated waitFor mechanism.

  4. Hydration - Serialize and deserialize a store to/from a QVariantMap object.

New Components

  1. MiddlewareList & Middleware

  2. Store

  3. Hydrate

See Reference Document for details

Bug Fix

https://bugreports.qt.io/browse/QTBUG-58133

Other

Changes

Store Examples

Multiple singleton Stores

Store {
  id: bridge
  stores: [
    PhotoAlbumStore,
    NavigationStore
  ]  
}

A single singleton Store

Store {
  id: rootStore

  property alias photoAlbum: photoAlbum

  PhotoAlbumStore {
    id: photoAlbum
  }

  property alias navigationStore: navigation

  NavigationStore {
    id: navigation
  }
}

What is new in QuickFlux 1.1?

Hydration Example

Hydrate is responsible for taking a snapshot of store and restore back to any state. It may be used with ViewStack.pri (a stateful StackView) to simulate different condition of UI.

var snapshot = Hydrate.dehydrate(MainStore); // Convert the data field of MainStore into a JSON object
...
Hydrate.rehydrate(MainStore, snapshot1); // 
...
Hydrate.rehydrate(MainStore, snapshot2);