Comments (4)
andresier wrote Jan 27 at 7:45 AM
Have you considered using a Tuple
type structure to achieve this yourself?
e.g. Tuple<T, T>
Your scan function could promote the previous update into the first item, and your current item into the 2nd.
If you want to hold more, simply change the Scan to use Tuple<T, T, T....>
and create a new Tuple
each scan but with the items shifted along.
Just an idea, in case you had not considered it - because it is relatively simple to achieve this yourself.
from reactive.
sirinath wrote Jan 27 at 8:10 AM
I raised this with the exception that this change would be replicated in other ports where there no tuple type. E.g. RxJava.
The tuple solution would be confined to the .net and a few other ports.
from reactive.
andresier wrote Jan 27 at 10:35 AM
Tuple was an example (one I have used for something similar), but you could create your own alternative or simply use an array. It doesn't sound right to change the method signature of Scan to handle this.
Here is an example with array. It is written in C#, but I'm sure you can port it to Java.
Something like this (untested - just hand cranked it now):
source...
.Scan(new int[3], (a, b) => {
return new int[] { a[1], a[2], b };
})
Should produce an array each time, whereby you have the most recent 3 values.
from reactive.
sirinath wrote Jan 27 at 11:36 AM
This is fine. If you give a option to get n input and m output values the implementation may be more efficient.
The above will create a object each time it is evoked. Also if you want both input and output this becomes awkward as you need to keep a input data structure and output data structure.
from reactive.
Related Issues (20)
- Add examples for IntroToRx Disposables appendix
- Analyzer for usage guidelines HOT 1
- Update IntroToRx test chapter based on how we test Rx.NET itself
- Add concrete scenario for Subject Factory in IntroToRx
- Add BackOffRetry example in IntroToRx
- Fix sentence on IntroToRx book
- [Feature] GroupSequentialBy
- PageNotFoundError about https://www.reactiveui.net/slack HOT 2
- Referencing System.Reactive from a WinUI 3 app or library is causing XLS errors to display in VS while XAML files are open HOT 1
- Possible Deadlock in BehaviorSubject.Subscribe HOT 2
- Incorporate https://github.com/runceel/ReactiveProperty HOT 5
- Throttle breaks the observable chain while running on wasm in .net 8 HOT 5
- Issue with CancellationToken lifetime in Observable.Using (async version) HOT 1
- Window and Buffer operators omit items which are released immediately HOT 3
- Benchmarks don't run for .NET 6+
- TestScheduler WithAsync swallows all exceptions making all tests pass HOT 3
- Publish symbols for assemblies in this package HOT 1
- Union doesn't dispose enumerator for empty lists HOT 1
- IntroToRx recommends wrong Window overload
- Fully update Ix for .NET SDK 8.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactive.