GithubHelp home page GithubHelp logo

yarikth / ureact Goto Github PK

View Code? Open in Web Editor NEW
155.0 6.0 9.0 2.28 MB

Functional reactive programming library for c++

License: Boost Software License 1.0

CMake 7.49% C++ 90.09% Makefile 0.60% Shell 0.14% Python 1.68%
c-plus-plus cross-platform header-only cpp cpp17 c-plus-plus-17 frp-library functional-reactive-programming frp

ureact's Introduction

µReact

Linux Windows MacOS CodeQL codecov

Standard Type GitHub license download Docs GitHub Releases PRs Welcome

µReact is an open-source header-only functional reactive programming library for C++17.

❗️ This library is a work-in-progress. It should not be considered release quality yet and its API might still change.
However, it works perfectly fine and can be already used with small future changes in mind.
Feedback is strongly required and appreciated to stabilize the API and achieve the first major release.

Documentation

Features

  • Update minimality: nothing is re-calculated or processed unnecessarily
  • Glitch freedom: no transiently inconsistent data sets
  • Externally synchronized (not thread-safe) by design: it allows not to pay for what you don't use and to have very determined consistent behaviour
  • Ease of use: small self-contained single header code base, no external dependencies, permissive Boost Software License license
  • Really easy to get started: it's just 1 header file
  • Reliability: the library has an extensive set of tests
  • Portability: continuously tested under Windows, MacOS and Ubuntu using MSVC/GCC/Clang
  • Clean warning-free codebase even on the most aggressive warning levels for MSVC/GCC/Clang
  • Doesn't pollute the global namespace (everything is in namespace ureact) and doesn't drag any headers with it

Examples

Basic usage (run)

#include <ureact/signal.hpp>
#include <ureact/adaptor/lift.hpp>
#include <iostream>

int main() {
    ureact::context ctx;

    // Declaring reactive variables. We can reassign their values later
    ureact::var_signal<int> b = make_var( ctx, 1 );
    ureact::var_signal<int> c = make_var( ctx, 2 );

    // Defining reactive signal using overloaded operator
    // Its value will be updated each time its dependencies are changed
    ureact::signal<int> a = b + c;

    std::cout << "a (init): " << a.get() << "\n"; // 3

    // Assign a new value to 'b'. Value of 'a' is recalculated automatically
    b <<= 10;
    std::cout << "a  (new): " << a.get() << "\n"; // 12
}

License

This software is licensed under the Boost Software License 1.0:

Copyright © 2014-2017 Sebastian Jeckel

Copyright © 2020-2023 Krylov Yaroslav

Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


This software started out as a fork of the cpp.react by Sebastian Jeckel ([email protected]), BSL 1.0 licensed.

Used third-party tools

The library itself consists of a single header file licensed under the Boost Software License license. However, it is built, tested, documented, and whatnot using a lot of third-party tools and services. Thanks a lot!

Contact

If you have questions regarding the library, I would like to invite you to open an issue at GitHub. Please describe your request, problem, or question as detailed as possible, and also mention the version of the library you are using as well as the version of your compiler and operating system. Opening an issue at GitHub allows other users and contributors to this library to collaborate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.