Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
fchorney committed Apr 10, 2024
1 parent 7fc4f9d commit 08f2bbd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdk/smx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ class SMXEvents {
this.output$ = new Bacon.Bus<Array<number>>();

// Config writes should only happen at most once per second.
const configOutput$ = this.output$.filter((e) => e[0] === API_COMMAND.WRITE_CONFIG_V5).throttle(1000);
const configOutput$ = this.output$.filter((e) => {
return e[0] === API_COMMAND.WRITE_CONFIG || e[0] === API_COMMAND.WRITE_CONFIG_V5
}).throttle(1000);

// All other writes are passed through unchanged
const otherOutput$ = this.output$.filter((e) => e[0] !== API_COMMAND.WRITE_CONFIG_V5);
const otherOutput$ = this.output$.filter((e) => {
return e[0] !== API_COMMAND.WRITE_CONFIG && e[0] !== API_COMMAND.WRITE_CONFIG_V5
});

// combine together the throttled and unthrottled writes
// and only emit one per each "ok" signal we get back following each previous output
Expand Down

0 comments on commit 08f2bbd

Please sign in to comment.