Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@most/core
Advanced tools
________________________________
___ |/ /_ __ \_ ___/__ __/
__ /|_/ /_ / / /____ \__ /
_ / / / / /_/ /____/ /_ /
/_/ /_/ \____/______/ /_/
The high-performance reactive event stream core that powers Most.
Specifically, @most/core
features Most's battle-tested, high-performance architecture with a lean, functions-only, curried API in a tree-shakeable package.
npm install --save @most/core
Here's a simple program that displays the result of adding two inputs. The result is reactive and updates whenever either input changes.
First, the HTML fragment for the inputs and a place to display the live result:
<form>
<input class="x"> + <input class="y"> = <span class="result"></span>
</form>
Using @most/core
to make it reactive:
import { combine, runEffects, createDefaultScheduler } from '@most/core'
import { input } from '@most/dom-event'
const xInput = document.querySelector('input.x')
const yInput = document.querySelector('input.y')
const resultNode = document.querySelector('.result')
const add = (x, y) => x + y
const toNumber = e => Number(e.target.value)
const renderResult = result => {
resultNode.textContent = result
}
// x represents the current value of xInput,
// updated on 'input' events
const x = map(toNumber), input(xInput))
// y represents the current value of yInput,
// updated on 'input' events
const y = map(toNumber), input(yInput))
// result is the live current value of adding x and y
// also updated on 'input' events from either
// xInput or yInput
const result = combine(add, x, y)
// Side effect to update the DOM
const update = tap(renderResult, result)
// Observe the result, causing the DOM to be updated
runEffects(update, createDefaultScheduler())
FAQs
Reactive programming with lean, functions-only, curried, tree-shakeable API
The npm package @most/core receives a total of 30,646 weekly downloads. As such, @most/core popularity was classified as popular.
We found that @most/core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.