-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Define rx.lite.js #58
Comments
skip/take subset, connect (as far as we have publish), selectProperty, repeat (if we'll include skip/take), merge |
Ok, added those. |
Publish is super important. I'm glad we added those. Looks good to me. If Erik were here, I'd hope he'd make a joke about RxLite just needing SelectMany. :) |
@cwharris it is true that you can write most operators in terms of |
All the tests pass for now but here's what I have Feedback welcome! Ok, how about the following so far: To see what's in there, here's the GruntFile which has the highlighted operators. I might have too many on the time-based side, but would love feedback! |
The "lite" version looks heavy to me. rxlite.js: rxjs.js: |
@RainerAtSpirit It is, but you have to realize, it has all the bindings, async/fromEvent/Promise/Callback stuff in addition to standard operators. Thus you don't need to bring in multiple files. I'd like to know which operators you think aren't needed. |
Based on the description above I wasn't expecting a "all-inclusive" lite version, thanks for the clarification. re operators: started using rx.js just recently, so I don't feel comfortable recommending yet. |
@RainerAtSpirit @theghostbel @cwharris should we drop all notion of absolute time here? That might help file size since in JS, we'd rarely use that anyhow. Nothing is stopping you from doing: var ts = 5000; /* ms */
var scheduleTime = new Date(Date.now() + ts);
var timer = Rx.Observable.timer(scheduleTime - Scheduler.now()); |
I don't see any real need for absolute time. The cases in which one might need that seem far a few between, unless you're using it for testing, in which case you could presumable hot-swap rx.lite for the usual rx libraries. |
As mentioned on twitter, IMO it'd be better to create actual separate repos for each module that addresses a clear separate concern. For example all the You'll probably also have some module which provides core For lots of the The creation combinators should each be in a separate package, except for maybe Additionally when I If however a |
If you wanted to break up RxJS into smaller modules (this may not even be worthwhile) I would look into splitting the core primitives into seperate packages. Like the pull system (observer) and the push system (observable). I would also look into how the scheduler could be broken out to be optional and have each scheduler type be a package. You could also put the test helping primitives into a seperate package. You don't need to break out all the functions that operate on Observer or Observable out. You can put all the Observer methods in However functions like
Could be broken out into a
And those could be broken out into an Note that if you do break out these functions, this style of seperating modules work cleaner in a functional style like Again this type of seperation is only worthwhile if you think these ideas can work together cleanly. It's definitely a lot easier if you don't have prototypical interface with 50 methods. Having seperate modules mutating a shared prototype leads to disaster if you ever include two versions of |
For now closing this as lite is good enough, and then creating smaller ones based upon this. |
Until we have custom builds under hand, would it make sense to create a smaller version of RxJS called RxLite which has a few operators. Which operators might fit?
Thoughts include the following:
Creation Operators
create
createWithDisposable
empty
fromArray
fromCallback
fromEvent
fromEventPattern
fromNodeCallback
fromPromise
interval
merge
never
repeat
return
timer
Combinators
do
map
/select
filter
/where
flatMap
/selectMany
flatMapLatest
/selectSwitch
combineLatest
zip
distinctUntilChanged
concat
concatObservable
merge
mergeObservable
multicast
publish
publishLatest
publishValue
repeat
replay
skip
skipUntil
skipWhile
take
takeUntil
takeWhile
throttle
timestamp
timeinterval
toArray
Any that I'm missing that are high priority?
The text was updated successfully, but these errors were encountered: