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 🙏

© 2026 – Pkg Stats / Ryan Hefner

matrixphere

v0.0.7

Published

버전: 0.0.7 | 작성일: 2025-03-27

Readme

Matrixphere 가이드

버전: 0.0.7 | 작성일: 2025-03-27

목차

개요

매트릭스피어 (Matrixphere): 여러 상태들이 결합된 원형의 집합체. State는 Redux Store를 기반으로 상태를 전역으로 관리하며 Rxjs, Redux Subscribe 등으로 상태값의 핸들링을 매우 유연하게 처리할 수 있음.

호출 방법

ESM

import { m$, stateObservable } from 'matrixphere'

UMD

<script src="matrixphere"></script> // html
...
const { m$, stateObservable } = Matrixphere // js script

상태값 생성

m$.set({
    name: 'test', // string
    value: 'test', // any, 상태의 초기값
    actions: [{
        name: 'action1' // string
        method: (data: {state, action, ...}) => {
            // 해당 상태의 본 액션을 호출할때 실행할 스크립트
            return data // 리턴할 떄는 data형식 그대로 리턴해주어야함.
        }
        // actions는 observable을 사용할 수 없음.
    }],
    // 실행하기 전 사전에 실행되는 스크립트
    // 일반 함수는 data형식 그대로 리턴해야하며 observable 구조는 리턴 없음. 혼용 가능.
    before: (data: {state, action, ...}) => {
            return data
    },
    after: (data: {state, action, ...}) => {
        // 해당 상태 호출이 끝나고 실행할 스크립트
        // 리턴 없음
    },
    undo: (data: {state, action, ...}): void => {
        // 해당 상태의 undo시 실행할 스크립트
        // 리턴 없음
    },
    // 아래와 같이 rxjs observable 구조로도 사용 가능.
    redo: new stateObservable()
        .pipe(
            // rxjs 기능들과 같이 사용할 수 있음.
            filter( (data: {state, action, ...}) => { // filter의 경우 rxjs의 filter를 임포트 시켜야 함.
                console.log(data)
                console.log('pipe')
                return true
            })
        ).subscribe({
            next: (data: any) => {
                console.log('next')
            }
        })
})

상태값 호출

m$.get('test') // test 상태값 호출
console.log(m$.getState()) // 전체 상태값 호출

상태값 업데이트

m$.update('test', 'test2') // test의 상태값을 test2로 변경
m$.action('test', 'action1', 'test3') // test의 커스텀 액션 action1을 test3값을 전달하면서 실행

상태값 삭제

m$.remove('test') // test 상태 삭제

시스템 상태 및 기능

System 상태값인 initial$, history$가 있음.

  • initial$: 상태의 초기값을 저장하는 저장소, 따로 액션을 호출하지 않아도 상태 생성 시 자동으로 저장됨.
  • history$: 모든 상태에 대해 변경 감지 시 이전 값을 past: [] 에 저장하는 저장소, Undo, Redo 기능 구현에 사용되며 사용자가 따로 액션을 호출할 경우는 없음.

UNDO, REDO

m$.undo()
m$.redo()