Skip to content

Commit a4031ce

Browse files
authored
housekeeping: Cleanup the readme a bit more (#2635)
1 parent b210c14 commit a4031ce

File tree

1 file changed

+14
-201
lines changed

1 file changed

+14
-201
lines changed

README.md

Lines changed: 14 additions & 201 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
[![NuGet Stats](https://img.shields.io/nuget/v/reactiveui.svg)](https://www.nuget.org/packages/reactiveui) ![Build](https://github.com/reactiveui/ReactiveUI/workflows/Build/badge.svg)
1+
![Build](https://github.com/reactiveui/ReactiveUI/workflows/Build/badge.svg)
22
[![Code Coverage](https://codecov.io/gh/reactiveui/ReactiveUI/branch/main/graph/badge.svg)](https://codecov.io/gh/reactiveui/ReactiveUI) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://reactiveui.net/contribute)
33
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=reactiveui/ReactiveUI)](https://dependabot.com)
44
<br>
55
<a href="https://www.nuget.org/packages/reactiveui">
66
<img src="https://img.shields.io/nuget/dt/reactiveui.svg">
77
</a>
8-
<a href="#backers">
9-
<img src="https://opencollective.com/reactiveui/backers/badge.svg">
10-
</a>
11-
<a href="#sponsors">
12-
<img src="https://opencollective.com/reactiveui/sponsors/badge.svg">
13-
</a>
8+
149
<a href="https://reactiveui.net/slack">
1510
<img src="https://img.shields.io/badge/chat-slack-blue.svg">
1611
</a>
@@ -29,20 +24,6 @@
2924
<h2>Book</h2>
3025
There has been an excellent <a href="https://kent-boogaart.com/you-i-and-reactiveui/">book</a> written by our Alumni maintainer Kent Boogart.
3126

32-
<h2>Introduction to Reactive Programming</h2>
33-
34-
Long ago, when computer programming first came to be, machines had to be programmed quite manually. If the technician entered the correct sequence of machine codes in the correct order, then the resulting program behavior would satisfy the business requirements. Instead of telling a computer how to do its job, which error-prone and relies too heavily on the infallibility of the programmer, why don't we just tell it what its job is and let it figure the rest out?
35-
36-
ReactiveUI is inspired by the paradigm of Functional Reactive Programming, which allows you to model user input as a function that changes over time. This is super cool because it allows you to abstract mutable state away from your user interfaces and expresses the idea around a feature in one readable place whilst improving application testability. Reactive programming can look scary and complex at first glance, but the best way to describe reactive programming is to think of a spreadsheet:
37-
38-
![](https://reactiveui.net/docs/frp-excel.gif)
39-
40-
* Three cells, A, B, and C.
41-
* C is defined as the sum of A and B.
42-
* Whenever A or B changes, C reacts to update itself.
43-
44-
That's reactive programming: changes propagate throughout a system automatically. Welcome to the peanut butter and jelly of programming paradigms. For further information, please watch this video from the Xamarin Evolve conference - [Why You Should Be Building Better Mobile Apps with Reactive Programming](http://www.youtube.com/watch?v=DYEbUF4xs1Q) by Michael Stonis.
45-
4627
<h2>NuGet Packages</h2>
4728

4829
Install the following packages to start building your own ReactiveUI app. <b>Note:</b> some of the platform-specific packages are required. This means your app won't perform as expected until you install the packages properly. See the <a href="https://reactiveui.net/docs/getting-started/installation/">Installation</a> docs page for more info.
@@ -125,187 +106,31 @@ Install the following packages to start building your own ReactiveUI app. <b>Not
125106
[ValBadge]: https://img.shields.io/nuget/v/ReactiveUI.Validation.svg
126107
[ValDocs]: https://reactiveui.net/docs/handbook/user-input-validation/
127108

128-
<h2>A Compelling Example</h2>
129-
130-
Let’s say you have a text field, and whenever the user types something into it, you want to make a network request which searches for that query.
131-
132-
![](http://i.giphy.com/xTka02wR2HiFOFACoE.gif)
133-
134-
```csharp
135-
public interface ISearchViewModel
136-
{
137-
string SearchQuery { get; set; }
138-
ReactiveCommand<string, IEnumerable<SearchResult>> Search { get; }
139-
IEnumerable<SearchResult> SearchResults { get; }
140-
}
141-
```
142-
143-
<h3>Define under what conditions a network request will be made</h3>
144-
145-
We're describing here, in a *declarative way*, the conditions in which the Search command is enabled. Now our Command IsEnabled is perfectly efficient, because we're only updating the UI in the scenario when it should change.
146-
147-
```csharp
148-
var canSearch = this.WhenAnyValue(x => x.SearchQuery, query => !string.IsNullOrWhiteSpace(query));
149-
```
150-
151-
<h3>Make the network connection</h3>
152-
153-
ReactiveCommand has built-in support for background operations and guarantees that this block will only run exactly once at a time, and that the CanExecute will auto-disable and that property IsExecuting will be set accordingly whilst it is running.
154-
155-
```csharp
156-
Search = ReactiveCommand.CreateFromTask(_ => searchService.Search(this.SearchQuery), canSearch);
157-
```
158-
159-
<h3>Update the user interface</h3>
160-
161-
ReactiveCommands are themselves `IObservables`, whose values are the results from the async method, guaranteed to arrive on the UI thread. We're going to take the list of search results that the background operation loaded, and turn them into our SearchResults property declared as [`ObservableAsPropertyHelper<T>`](https://reactiveui.net/docs/handbook/oaph/#example).
162-
163-
```csharp
164-
_searchResults = Search.ToProperty(this, x => x.SearchResults);
165-
```
166-
167-
<h3>Handling failures</h3>
168-
169-
Any exception thrown from the [`ReactiveCommand.CreateFromTask`](https://reactiveui.net/docs/handbook/commands/) gets piped to the `ThrownExceptions` Observable. Subscribing to this allows you to handle errors on the UI thread.
170-
171-
```csharp
172-
Search.ThrownExceptions.Subscribe(error => { /* Handle exceptions. */ });
173-
```
174-
175-
<h3>Throttling network requests and automatic search execution behaviour</h3>
176-
177-
Whenever the Search query changes, we're going to wait for one second of "dead airtime", then automatically invoke the subscribe command.
178-
179-
```csharp
180-
this.WhenAnyValue(x => x.SearchQuery)
181-
.Throttle(TimeSpan.FromSeconds(1), RxApp.MainThreadScheduler)
182-
.InvokeCommand(Search);
183-
```
184-
185-
<h3>Binding our ViewModel to the platform-specific UI</h3>
186-
187-
ReactiveUI fully supports XAML markup bindings, but we have more to offer. [ReactiveUI Bindings](https://reactiveui.net/docs/handbook/data-binding/) work on **all platforms**, including Xamarin Native and Windows Forms, and operate the same. Those bindings are strongly typed, and renaming a ViewModel property, or a control in the UI layout without updating the binding, the build will fail.
188-
189-
```csharp
190-
this.WhenActivated(cleanup =>
191-
{
192-
this.Bind(ViewModel, x => x.SearchQuery, x => x.TextBox)
193-
.DisposeWith(cleanup);
194-
this.OneWayBind(ViewModel, x => x.SearchResults, x => x.ListView)
195-
.DisposeWith(cleanup);
196-
this.BindCommand(ViewModel, x => x.Search, x => x.Button)
197-
.DisposeWith(cleanup);
198-
});
199-
```
200-
201-
<h3>Forget about INotifyPropertyChanged boilerplate code</h3>
202-
203-
[ReactiveUI.Fody](https://www.nuget.org/packages/ReactiveUI.Fody/) package allows you to decorate read-write properties with `Reactive` attribute — and code responsible for property change notifications will get injected into your property setters automatically at compile time. We use [Fody](https://github.com/Fody/Fody) tooling to make this magic work.
204-
205-
```csharp
206-
public class ReactiveViewModel : ReactiveObject
207-
{
208-
[Reactive]
209-
public string SearchQuery { get; set; }
210-
}
211-
```
212-
213-
The code above gets compiled into the following code:
214-
215-
```csharp
216-
public class ReactiveViewModel : ReactiveObject
217-
{
218-
private string searchQuery;
219-
public string SearchQuery
220-
{
221-
get => searchQuery;
222-
set => this.RaiseAndSetIfChanged(ref searchQuery, value);
223-
}
224-
}
225-
```
109+
<h2>Sponsorship</h2>
226110

227-
<h3>Validate user input on the fly</h3>
111+
The core team members, ReactiveUI contributors and contributors in the ecosystem do this open-source work in their free time. If you use ReactiveUI, a serious task, and you'd like us to invest more time on it, please donate. This project increases your income/productivity too. It makes development and applications faster and it reduces the required bandwidth.
228112

229-
[ReactiveUI.Validation](https://github.com/reactiveui/ReactiveUI.Validation) provides a subset of functions to create validations, functioning in a reactive way. For those ViewModels which need validation, implement `ISupportsValidation`, then add validation rules to the ViewModel and finally bind to the validation rules in the View! See the [documentation](https://reactiveui.net/docs/handbook/user-input-validation/) for more info. This package was created based on [jcmm33 work](https://github.com/jcmm33/ReactiveUI.Validation) and maintained by [alexmartinezm](https://github.com/alexmartinezm).
113+
[Become a sponsor](https://github.com/sponsors/reactivemarbles).
230114

231-
```csharp
232-
// # ViewModel
233-
// Search query must not be empty. The selector is the property
234-
// name and the line below is a single property validator.
235-
this.ValidationRule(
236-
vm => vm.SearchQuery,
237-
query => !string.IsNullOrWhiteSpace(query),
238-
"Please, provide a non-empty search query!");
115+
This is how we use the donations:
239116

240-
// # View
241-
// Bind any validations which reference the SearchQuery property
242-
// to the text of the QueryValidation UI control!
243-
this.BindValidation(ViewModel, vm => vm.SearchQuery, view => view.QueryValidation.Text);
244-
```
245-
246-
<h3>Add view model-based routing to your XAML views</h3>
247-
248-
View model-based routing is supported for Xamarin.Forms, WinRT, UWP, Windows Forms, WPF and Avalonia Desktop applications. Create an [`IScreen`](https://reactiveui.net/api/reactiveui/iscreen/), register views for view models and navigate to your [`IRoutableViewModel`](https://reactiveui.net/api/reactiveui/iroutableviewmodel/)s by calling `Router.Navigate`. Then, bind the [`RoutingState`](https://reactiveui.net/api/reactiveui/routingstate/) to the platform-specific routed view host. See [routing documentation](https://reactiveui.net/docs/handbook/routing/) for a getting started guide.
249-
250-
```xml
251-
<rxui:ReactiveWindow
252-
xmlns:rxui="http://reactiveui.net"
253-
x:Class="ReactiveRouting.MainWindow"
254-
x:TypeArguments="vm:MainViewModel"
255-
xmlns:vm="clr-namespace:ReactiveRouting"
256-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
257-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
258-
<rxui:RoutedViewHost
259-
Router="{Binding Router}"
260-
HorizontalContentAlignment="Stretch"
261-
VerticalContentAlignment="Stretch" />
262-
</rxui:ReactiveWindow>
263-
```
117+
* Allow the core team to work on ReactiveUI
118+
* Thank contributors if they invested a large amount of time in contributing
119+
* Support projects in the ecosystem
264120

265121
<h2>Support</h2>
266122

267123
If you have a question, please see if any discussions in our [GitHub issues](https://github.com/reactiveui/ReactiveUI/issues) or [Stack Overflow](https://stackoverflow.com/questions/tagged/reactiveui) have already answered it.
268124

269125
If you want to discuss something or just need help, here is our [Slack room](https://reactiveui.net/slack), where there are always individuals looking to help out!
270126

271-
If you are twitter savvy, you can tweet #reactiveui with your question and someone should be able to reach out and help also.
272-
273-
If you have discovered a 🐜 or have a feature suggestion, feel free to create an issue on GitHub.
127+
Please do not open GitHub issues for support requests.
274128

275129
<h2>Contribute</h2>
276130

277-
ReactiveUI is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. Because of our Open Collective model for funding and transparency, we are able to funnel support and funds through to our contributors and community. We ❤ the people who are involved in this project, and we’d love to have you onboard, especially if you are just getting started or have never contributed to open-source before.
278-
279-
So here's to you, lovely person who wants to join us — this is how you can support us:
280-
281-
* [Responding to questions on StackOverflow](https://stackoverflow.com/questions/tagged/reactiveui)
282-
* [Passing on knowledge and teaching the next generation of developers](http://ericsink.com/entries/dont_use_rxui.html)
283-
* [Donations](https://reactiveui.net/donate) and [Corporate Sponsorships](https://reactiveui.net/sponsorship)
284-
* [Submitting documentation updates where you see fit or lacking](https://reactiveui.net/docs)
285-
* [Making contributions to the code base](https://reactiveui.net/contribute/)
286-
* [Asking your employer to reciprocate and contribute to open-source](https://github.com/github/balanced-employee-ip-agreement)
287-
288-
We're also looking for people to assist with code reviews of ReactiveUI contributions. Please join us on <a href="https://reactiveui.net/slack">Slack</a> to discuss how.
289-
<!--
290-
- [Android reviewers](https://github.com/orgs/reactiveui/teams/android-team)
291-
- [Apple TV reviewers](https://github.com/orgs/reactiveui/teams/tvos-team)
292-
- [Dot Net Core](https://github.com/orgs/reactiveui/teams/dotnetcore-team)
293-
- [Fody reviewers](https://github.com/orgs/reactiveui/teams/fody-team)
294-
- [iOS reviewers](https://github.com/orgs/reactiveui/teams/ios-team)
295-
- [Learning Team reviewers](https://github.com/orgs/reactiveui/teams/learning-team)
296-
- [Mac reviewers](https://github.com/orgs/reactiveui/teams/mac-team)
297-
- [ReactiveUI Core reviewers](https://github.com/orgs/reactiveui/teams/core-team)
298-
- [Tizen](https://github.com/orgs/reactiveui/teams/tizen-team)
299-
- [UWP reviewers](https://github.com/orgs/reactiveui/teams/uwp-team)
300-
- [Web Assembly](https://github.com/orgs/reactiveui/teams/webassembly-team)
301-
- [WinForms reviewers](https://github.com/orgs/reactiveui/teams/winforms-team)
302-
- [WPF reviewers](https://github.com/orgs/reactiveui/teams/wpf-team)
303-
- [Xamarin Forms reviewers](https://github.com/orgs/reactiveui/teams/xamarin-forms-team)
304-
-->
131+
ReactiveUI is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use.
305132

306-
<h2>.NET Foundation</h2>
307-
308-
ReactiveUI is part of the [.NET Foundation](https://www.dotnetfoundation.org/). Other projects that are associated with the foundation include the Microsoft .NET Compiler Platform ("Roslyn") as well as the Microsoft ASP.NET family of projects, Microsoft .NET Core & Xamarin Forms.
133+
If you want to submit pull requests please first open a [GitHub issue](https://github.com/reactiveui/ReactiveUI/issues/new/choose) to discuss. We are first time PR contributors friendly.
309134

310135
<h2>Core Team</h2>
311136

@@ -387,18 +212,6 @@ The following have been core team members in the past.
387212
</tbody>
388213
</table>
389214

390-
<h2>Contributors</h2>
391-
This project exists thanks to all the people who have contributed to the code base.
392-
<a href="https://github.com/ReactiveUI/ReactiveUI/graphs/contributors"><img src="https://opencollective.com/ReactiveUI/contributors.svg?width=890&button=false" /></a>
393-
394-
<h2>Sponsorship</h2>
395-
396-
The core team members, ReactiveUI contributors and contributors in the ecosystem do this open-source work in their free time. If you use ReactiveUI, a serious task, and you'd like us to invest more time on it, please donate. This project increases your income/productivity too. It makes development and applications faster and it reduces the required bandwidth.
397-
398-
[Become a sponsor](https://github.com/sponsors/reactivemarbles).
399-
400-
This is how we use the donations:
215+
<h2>.NET Foundation</h2>
401216

402-
* Allow the core team to work on ReactiveUI
403-
* Thank contributors if they invested a large amount of time in contributing
404-
* Support projects in the ecosystem
217+
ReactiveUI is part of the [.NET Foundation](https://www.dotnetfoundation.org/). Other projects that are associated with the foundation include the Microsoft .NET Compiler Platform ("Roslyn") as well as the Microsoft ASP.NET family of projects, Microsoft .NET Core & Xamarin Forms.

0 commit comments

Comments
 (0)