Skip to content

Instantly share code, notes, and snippets.

@deanshub
Created June 6, 2019 10:41
Show Gist options
  • Save deanshub/4cfd0424dd8e60b5cf8edafbf2f9dd5e to your computer and use it in GitHub Desktop.
Save deanshub/4cfd0424dd8e60b5cf8edafbf2f9dd5e to your computer and use it in GitHub Desktop.
import Strim from 'strim-js'
new Strim()
.pipe({
module: 'dom',
func: 'getDataFromElements',
args: ['#userInput1','#userInput2','#userInput3','#userInput4'],
})
.toWorker()
.pipe({
module: 'dataCrunch',
func: 'sum',
})
.toServer()
.pipe({
module: 'dataCrunch',
func: 'avgWithOtherResults',
})
.toWorker()
.pipe({
module: 'dataCrunch',
func: 'otherMlStuff',
args: {weights: 0.3, dropout: 0.7},
})
.toClient()
.subscribe({
next: result => {
console.log(`the result is:${result}`)
},
error: err => {
throw new Error(err)
},
complete: () => {
console.log('strim completed')
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment