Skip to content

Rx Lite!

Compare
Choose a tag to compare
@kirkshoop kirkshoop released this 25 Nov 20:54

A bug fix in group_by changed the way that groups end. see #249 for the explanation. code using group_by might have to add a take or take_until to get the same behavior that it had before.

A bug fix in zip changed the way that it ends. see #236 for the explanation.

Rx Lite!

@gchudnov and @kirkshoop embarked on a journey to change how operators are structured.

The new structure supports Rx Lite. Rx Lite does not include all operators by default. Each cpp file will include just the operators that it needs. There are static asserts to report missing includes.

To opt into Rx Lite

#include <rxcpp/rx-lite.hpp>
#include <rxcpp/operators/rx-filter.hpp>
#include <rxcpp/operators/rx-group_by.hpp>

In clang missing includes look like this

[ 44%] Building CXX object build/test/CMakeFiles/rxcpp_test_window.dir/operators/window.cpp.o
In file included from /Users/kirk/source/rxcpp/Rx/v2/test/operators/window.cpp:1:
In file included from /Users/kirk/source/rxcpp/Rx/v2/test/operators/../test.h:10:
In file included from /Users/kirk/source/rxcpp/Rx/v2/src/rxcpp/rx-lite.hpp:9:
In file included from /Users/kirk/source/rxcpp/Rx/v2/src/rxcpp/operators/../rx-includes.hpp:179:
/Users/kirk/source/rxcpp/Rx/v2/src/rxcpp/rx-operators.hpp:234:9: error: static_assert failed "missing include: please
      #include <rxcpp/operators/rx-reduce.hpp>"
        static_assert(Included::value, "missing include: please #include <rxcpp/operators/rx-reduce.hpp>");
        ^             ~~~~~~~~~~~~~~~

The new structure improves documentation by keeping all the code and documentation for the operator in the file for that operator and referring to the docs from observable<>

The new structure ensures that the observable<>. and operator| overloads for each operator are identical.

Not all operators have been moved to Rx Lite. This means that using Rx Lite in this release might cause build breaks (static asserts for missing includes) when moving to subsequent releases of Rx that have moved more operators to Rx Lite. This can be manually averted by including the needed headers now, but without the static asserts it will be hard to prove that the used operators are included.

thanks to all the contributors!

@gchudnov
@alexandrebourlon
@marcobusemann
@wutiantong
@diorcety
@xunilrj

@d-led
@maiermic
@thedillonb
@frankinshtein
@VorpalBlade
@ildarsharafutdinov
@helgoboss
@srdjantot
@sthekepat
@hoffis
@martinfinke

new operators!

debounce
exists
contains
any
timeout
with_latest_from
all
timestamp
window_toggle
take_last
skip_last
time_interval
switch_if_empty
default_if_empty
sequence_equal