ilokesto

패키지 표면

Public entrypoint 경로는 state/package.json의 exports가 기준입니다. 프레임워크 독립 생성 API는 root에서, 프레임워크 adapter는 각 subpath에서 가져오세요.

Entrypoint 표

ImportPurpose
@ilokesto/state프레임워크 독립적인 Store, createStore, createReducer, pipe, definePipeableMiddleware, PipeConfigurationError, dispose와 공개 상태 계약을 내보냅니다.
@ilokesto/state/reactReact create() adapter와 UseState, UseReducer type입니다.
@ilokesto/state/vueVue create() adapter와 UseState, UseReducer type입니다.
@ilokesto/state/svelteSvelte create() adapter와 UseState, UseReducer type입니다.
@ilokesto/state/solidSolid create() adapter와 UseState, UseReducer type입니다.
@ilokesto/state/angularAngular create() adapter와 AngularOptions, UseState, UseReducer type입니다.
@ilokesto/state/middleware등록된 middleware, store disposal, middleware type입니다.
@ilokesto/state/utilspipe builder, custom middleware 등록, configuration error, pipe type입니다.
@ilokesto/state/adaptoradaptor; optional immer peer가 필요합니다.
@ilokesto/state/package.json이 패키지 manifest가 필요한 tooling을 위한 package metadata export입니다.

Middleware export

@ilokesto/state/middleware는 debounce, throttle, devtools, dispose, history, HistoryConfigurationError, logger, persist, validate를 export합니다.

Public type은 HistoryControls, HistoryOptions, HistoryStore, OnRehydrateStorage, OnRehydrateStorageCallback, PersistControls, PersistDecoder, PersistDecoderStateDiagnostic, PersistMigration, PersistStore, SafePersistConfig, SafePersistCookieConfig, SafePersistLocalConfig, SafePersistSessionConfig입니다.

Utility export

@ilokesto/state/utils는 pipe, definePipeableMiddleware, PipeConfigurationError를 export합니다.

Public type은 Pipe, PipeAnyMiddleware, PipeBuilder, PipeCapability, PipeConfigurationErrorCode, PipeDuplicatePolicy, PipeMiddleware, PipeMiddlewareConflictDiagnostic, PipeMiddlewareMetadata입니다.

Root와 프레임워크 entrypoint

프레임워크 독립 생성 API는 root에서 가져오세요. create, bind, bindReducer 같은 프레임워크 adapter API는 root가 아니라 프레임워크 subpath에서 가져옵니다.

// 프레임워크 subpath에서 사용 가능
import { create } from '@ilokesto/state/react';
import { logger } from '@ilokesto/state/middleware';

Root의 createStore 또는 createReducer로 상태를 만들고 프레임워크 subpath의 bind 또는 bindReducer로 연결하세요. 프레임워크 독립 상태와 연결, 이전 가이드를 참고하세요.

Peer dependencies

프레임워크 peer는 optional입니다. 실제로 쓰는 어댑터의 프레임워크만 설치하세요. immer는 @ilokesto/state/adaptor의 adaptor를 사용할 때만 필요합니다.

목차