Skip to content

Reduks modules overhaul and more

Pre-release
Pre-release

Choose a tag to compare

@beyondeye beyondeye released this 10 Nov 09:18
· 3 commits to master since this release

Better actions / better ActionWithContext support:

  • added standard INIT action, that is dispatched when replaceReducer() is called and is used as default StartAction in ReduksModule definition and SingleModuleReduksActivity
  • Create actions with context with .. operator: ctx1..SomeAction() create an ActionWithContext with ctx1 as ReduksContext and SomeAction() as wrapped action. If the ctx1 is actually empty, then the '..' operator returns the unwrapped action instead.
  • added action matchers matchA and isA for ActionWithContext in a when expression. see ActionWithContextTest for examples:

Reduks modules ovehaul:

  • Performance of Reduks modules greatly improved and code greatly simplified: method count for core reduced by almost 20%
  • Reduks interface new extension functions subStore, subState, subDispatcher for making it easier to interact with substores in multimodule stores
  • added support for default ReduksContext equal to the substate class simpleName for making it easier to define multimodule stores
  • defining a StoreSubscriberBuilder and an initial action is now optional when defining Reduks modules (the default INIT start action will be used)

Integration of Reduks Bus with modules:

  • for a multimodule store, the reduks bus of the first substate that make a bus available will be used as the bus for the multimodule store

Various other improvements:

  • dispatch() and state are now extension functions for Reduks interface
  • added StoreSubscriberFn with second argument that is an automatically defined SelectorBuilder object that you can use for creating your selectors to use in the StoreSubscriber.
  • removed StoreCreator argument in initReduks for ReduksActivity and defined instead a separate
    method in ReduksActivity interface for providing the storeCreator (for better integration with Reduks modules)

Bug fix:

  • Removed StartKovenant/StopKovenant from KovenantReduksActivity

Dependencies updated:

  • kotlin : 1.0.5
  • kovenant : 3.3.0
  • android support lib: 24.2.1
  • gson :2.8.0