@stagas/immutable-list
Immutable list.
npm i @stagas/immutable-list
|
pnpm add @stagas/immutable-list
|
yarn add @stagas/immutable-list
|
Examples
# node
# web
# view source
example/web.ts
import { add } from '@stagas/immutable-list'
const main = document.querySelector('main')!
main.innerHTML = `<h1>1 + 2 = ${add(1, 2)}</h1>`
🥁 Use this template 🥁
Features
- TypeScript with SWC
- JSX/TSX out of the box
- Outputs both CommonJS and ES Modules, ready to publish on npm
- Automatic dist bundling using bunzee
- Documentation generation using dokio
- Isomorphic Node.js and real browser testing incl. coverage and snapshots with utr
- Examples / Playground using devito
- Evergreen using pull-configs
- ESLint
- dprint
- Husky
API
# off
(eventName, callback)
# on
(eventName, callback, options)
# options
EventEmitterOptions
on<K>(eventName, callback, options) =>
- Off
# once
(eventName, callback)
# emit
(eventName, args)
# insertAfterIndex
(index, newItem)
# insertAt
(index, newItem)
# off
(eventName, callback)
# on
(eventName, callback, options)
# options
EventEmitterOptions
on<K>(eventName, callback, options) =>
- Off
# once
(eventName, callback)
# removeById
(itemId)
# setById
(itemId, newItem)
# updateById
(itemId, updateData)
# createOrReturn
(ctor, prev, key, next)
# getItemInListById
(list, itemId)
# insertItemInListAtIndex
(list, index, newItem)
# removeItemInListById
(list, itemId)
# setItemInListById
(list, itemId, newItem)
# updateItemInListById
(list, itemId, updateData)
Credits
- everyday-types by stagas – Everyday utility types
- everyday-utils by stagas – Everyday utilities
Contributing
All contributions are welcome!