Comments (1)
Neither Airstream nor Scala have a concept of "side effects", so we can't really disallow that*. So yes, you can do dirty things inside operator callbacks, such as reading or updating a Var. It's not encouraged, but sometimes this can actually be useful to avoid more complex observable composition.
Relatedly, Airstream has shared execution, e.g. the fn
in stream.map(fn)
will be executed at most once per incoming event, whereas other streaming libraries tend to execute it N times per event if the resulting stream has N observers.
*BUT: you're not allowed to throw
when providing some callbacks. These are marked with Must not throw
in scaladoc comments. Usually there isn't a technical reason for it, I just felt it was unnecessary at the time. Maybe I'll get to adding guards in such cases some time.
PS I'm moving these issues to discussions. Apparently this closes the original issue, but the point is to move, not to close the discussion.
from airstream.
Related Issues (20)
- .split operator is hard to use without Laminar
- Killing subscriptions from observers (?)
- splitByType / splitByEnum HOT 6
- Can `DerivedVar` support `map/update` semantics in addition to `map/contramap` semantics? HOT 2
- Add an AjaxStream upload progress observer
- FetchStream does not emit events if it's initialized outside of a transaction HOT 1
- [Question] Simulate DomEventStream click on page load HOT 5
- idiomatic usage of foreach for EventStream HOT 4
- RFC: Should we import-gate flatMap? HOT 7
- Semantics of `toSignal` HOT 1
- Sampling a signal shouldn't cause the overhead of observers HOT 1
- Documentation: Observers Feeding into Var HOT 5
- Var: batch set regression in 0.13 HOT 1
- Airstream semantics update – RFC HOT 12
- Remove `ConcurrentFutureStrategy`, `OverwriteFutureStrategy`, and `ConcurrentFutureStream` – RFC
- flatMap internal observer unsubscription bug HOT 4
- Add method variant of EvenStream.merge? HOT 5
- Update and get HOT 5
- add flatmap to ReactiveEventProp HOT 2
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 airstream.