-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BaconJS examples? #133
Comments
Hi @frankandrobot, I would love if you can have a look at
|
As I said above, we need a debounce. Here's an initial first pass.
function* debouce(inc, timeout) {
var scheduler
const outc = csp.chan();
csp.go(function* () {
while(true) {
const next = yield csp.take(inc);
scheduler && clearTimeout(scheduler);
scheduler = setTimeout(
() => {
csp.put(outc, next);
},
timeout);
}
});
return outc;
} (I apologize also for the tabs. Need to config emacs) |
I think you can create a PR with your implementation into the examples folder. It would be easier for anyone to review |
What formatting changes? |
code inside script tag formatting. This should be an example https://github.com/frankandrobot/js-csp/blob/master/examples/web/throttle.html. Your code need to be proper format like this example. |
I think the code for |
Another example worth doing (and it doesn't have to be a web example) is var userPasswordStream = // fires when user enters password and presses OK
var tokenStream = userPasswordStream.flatMapLatest(login) // where `login` is an AJAX request For a non-web example, see https://rpominov.github.io/kefir/#flat-map-latest
|
In the docs you ask for help porting over the BaconJS examples. Any particular examples you had an mind? Note that we would need to add a
debounce
as streams/observables make extensive use of debouncing streams.The text was updated successfully, but these errors were encountered: