MCPcopy
hub / github.com/goatslacker/alt / getState

Function getState

src/store/index.js:46–54  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

44export function createStoreConfig(globalConfig, StoreModel) {
45 StoreModel.config = fn.assign({
46 getState(state) {
47 if (Array.isArray(state)) {
48 return state.slice()
49 } else if (fn.isMutableObject(state)) {
50 return fn.assign({}, state)
51 }
52
53 return state
54 },
55 setState(currentState, nextState) {
56 if (fn.isMutableObject(nextState)) {
57 return fn.assign(currentState, nextState)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected