Sha256: 5ca40304b33dce5acbae934adbc3074abe6690ed75f35e898b7cd122f43b123e
Contents?: true
Size: 887 Bytes
Versions: 33
Compression:
Stored size: 887 Bytes
Contents
module LucidComponent class AppStoreProxy def initialize(native) @native = native end def [](key) method_missing(key) end def []=(key, value) method_missing(key, value) end def method_missing(key, *args, &block) if `args.length > 0` # set class state, simply a dispatch action = { type: 'APPLICATION_STATE', name: (`key.endsWith('=')` ? key.chop : key), value: args[0] } Isomorfeus.store.collect_and_defer_dispatch(action) else # check if we have a component local state value if `#@native?.props?.iso_store?.application_state?.hasOwnProperty?.(key)` return `#@native.props.iso_store.application_state[key]` else return AppStore[key] end # otherwise return nil return nil end end end end
Version data entries
33 entries across 33 versions & 1 rubygems