npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

datass

v0.0.111111

Published

datass helps you finish quicker. its lightweight, flexible, and unopinionated.

Downloads

4

Readme

// goddammitcopilot just tellme how I make an image in markdowm DATASS

data super store [WIP]

its lightweight, flexible, and unopinionated. if ur feeling like switching it up, u should give datass a shot.

Jokes aside...

datass is a state management library for React that experimentally focuses on minimizing re-renders.

Selectors are cached and even when a store's state changes a datass store hook will only cause a component to re-render if the result of the selector is different from the previous result.

Consider this:

// We create a store with an array of numbers.
const $numbers = datass.array([1, 2, 3, 4, 5])

// We hook into the store inside of a component using
// a hook/selector that filters out any odd numbers.
// The result here is [2, 4].
const evenNumbers = $numbers.useFilter((number) => number % 2 === 0)

// We then update the store with a new set of numbers, but
// we leave out any odd numbers.
$numbers.set([2, 4])

In the case above, the hook into $numbers will not cause a re-render because the resulting length and values of the array produced by the selector applied to [2, 4] is the same resulting length and values of the array produced by the selector applied to [1, 2, 3, 4, 5].

TODO: Thorough documentation.

import { datass } from 'datass'

const $isReady = datass.boolean(false)
$isReady.set(true)
$isReady.toggle()
$isReady.use()
$isReady.state

const isNotReady = $isReady.use((isReady) => !isReady)
const $count = datass.number(0)
$count.set(100)
$count.increment()
$count.decrement()
$count.use()
$count.state

const isCountEven = $count.use((count) => count % 2 === 0)
$count.set(102) // ^ this hook will not cause a re-render
// because the result of the selector using count as 102 is
// the same result as using count as 100.
const $name = datass.string('world')
$name.set('datass')
$name.use()
$name.state

const firstLetter = $name.use((name) => name[0])
$name.set('debbie') // ^ this hook will not cause a re-render
// because the result of the selector using 'debbie' as the
// name is the same result as using 'datass' as the name.
const $users = datass.array(['alice', 'bob', 'charlie'])
$users.set(['alice', 'bob', 'charlie', 'daniel'])
$users.useMap((user) => user.length)
$users.useFilter((user) => user.length > 5)
$users.state
const $person = datass.object({ name: 'alice', age: 20 })
$person.use((person) => person.name)
$person.set({ name: 'bob', age: 25 }) // causes a re-render
$person.set({ name: 'bob', age: 99 }) // does not cause a re-render
$person.state