isomorfeus-redux 23.8.0.rc1 → 23.8.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/redux/config.rb +104 -104
- data/lib/isomorfeus/redux/version.rb +1 -1
- data/lib/local_store.rb +40 -40
- data/lib/session_store.rb +41 -41
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36fa905c2ca34f3c7eb2c1076442ee168451efe370b608df2a360dca2aa64a79
|
4
|
+
data.tar.gz: 8fddf392d67374e25afa6daab8d071afe6db744301576a17e62a3d1e48d86285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91f087fb1c734afc83cdbd9a858cc332c52e1d05a87acaef2d6d7ab9e300fcb0944b8911ab8c19960a3b53fd74f470056a997c781f5b5cad47e9bb7579fa486a
|
7
|
+
data.tar.gz: 4214abfd96b479b3d5a464f57d0d4f38d22bf74d07e88214205c2b878a7feb18aee31977dff5c28644a96e320340b945c5c6509251cc3c03c3ce8d0828cd1766
|
@@ -1,104 +1,104 @@
|
|
1
|
-
# backtick_javascript: true
|
2
|
-
|
3
|
-
module Isomorfeus
|
4
|
-
if RUBY_ENGINE == 'opal'
|
5
|
-
class << self
|
6
|
-
attr_reader :store_initialized
|
7
|
-
attr_reader :store
|
8
|
-
|
9
|
-
def client_init_after_store_class_names
|
10
|
-
@client_init_after_store_class_names ||= []
|
11
|
-
end
|
12
|
-
|
13
|
-
def add_client_init_after_store_class_name(init_class_name)
|
14
|
-
client_init_after_store_class_names << init_class_name
|
15
|
-
end
|
16
|
-
|
17
|
-
def execute_init_classes
|
18
|
-
client_init_class_names.each do |constant|
|
19
|
-
constant.constantize.send(:init)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def execute_init_after_store_classes
|
24
|
-
client_init_after_store_class_names.each do |constant_name|
|
25
|
-
constant_name.constantize.send(:init)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def init_store
|
30
|
-
return if store_initialized
|
31
|
-
@store_initialized = true
|
32
|
-
force_init_store!
|
33
|
-
end
|
34
|
-
|
35
|
-
def force_init_store!
|
36
|
-
# at least one reducer must have been added at this stage
|
37
|
-
# this happened in isomorfeus-react.rb, where the component reducers were added
|
38
|
-
@store = ::Redux::Store.init!
|
39
|
-
`Opal.Isomorfeus.store = #@store`
|
40
|
-
end
|
41
|
-
|
42
|
-
def something_loading!
|
43
|
-
@something_loading = true
|
44
|
-
end
|
45
|
-
|
46
|
-
def something_loading?
|
47
|
-
res = @something_loading
|
48
|
-
@something_loading = false
|
49
|
-
res
|
50
|
-
end
|
51
|
-
|
52
|
-
def reset_something_loading
|
53
|
-
@something_loading = false
|
54
|
-
end
|
55
|
-
end
|
56
|
-
else # RUBY_ENGINE
|
57
|
-
class << self
|
58
|
-
attr_accessor :server_init_class_names
|
59
|
-
|
60
|
-
def execute_init_classes
|
61
|
-
server_init_class_names.each do |constant|
|
62
|
-
constant.constantize.send(:init)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def store_initialized
|
67
|
-
Thread.current[:@_isomorfeus_store_initialized]
|
68
|
-
end
|
69
|
-
|
70
|
-
def store
|
71
|
-
Thread.current[:@_isomorfeus_store]
|
72
|
-
end
|
73
|
-
|
74
|
-
def init_store
|
75
|
-
return if store_initialized
|
76
|
-
Thread.current[:@_isomorfeus_store_initialized] = true
|
77
|
-
force_init_store!
|
78
|
-
end
|
79
|
-
|
80
|
-
def force_init_store!
|
81
|
-
# at least one reducer must have been added at this stage
|
82
|
-
# this happened in isomorfeus-preact.rb, where the component reducers were added
|
83
|
-
Thread.current[:@_isomorfeus_store] = ::Redux::Store.init!
|
84
|
-
end
|
85
|
-
|
86
|
-
|
87
|
-
def something_loading!
|
88
|
-
Thread.current[:isomorfeus_something_loading] = true
|
89
|
-
end
|
90
|
-
|
91
|
-
def something_loading?
|
92
|
-
res = Thread.current[:isomorfeus_something_loading]
|
93
|
-
Thread.current[:isomorfeus_something_loading] = false
|
94
|
-
res
|
95
|
-
end
|
96
|
-
|
97
|
-
def reset_something_loading
|
98
|
-
Thread.current[:isomorfeus_something_loading] = false
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
server_init_class_names = []
|
103
|
-
end # RUBY_ENGINE
|
104
|
-
end
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
3
|
+
module Isomorfeus
|
4
|
+
if RUBY_ENGINE == 'opal'
|
5
|
+
class << self
|
6
|
+
attr_reader :store_initialized
|
7
|
+
attr_reader :store
|
8
|
+
|
9
|
+
def client_init_after_store_class_names
|
10
|
+
@client_init_after_store_class_names ||= []
|
11
|
+
end
|
12
|
+
|
13
|
+
def add_client_init_after_store_class_name(init_class_name)
|
14
|
+
client_init_after_store_class_names << init_class_name
|
15
|
+
end
|
16
|
+
|
17
|
+
def execute_init_classes
|
18
|
+
client_init_class_names.each do |constant|
|
19
|
+
constant.constantize.send(:init)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def execute_init_after_store_classes
|
24
|
+
client_init_after_store_class_names.each do |constant_name|
|
25
|
+
constant_name.constantize.send(:init)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def init_store
|
30
|
+
return if store_initialized
|
31
|
+
@store_initialized = true
|
32
|
+
force_init_store!
|
33
|
+
end
|
34
|
+
|
35
|
+
def force_init_store!
|
36
|
+
# at least one reducer must have been added at this stage
|
37
|
+
# this happened in isomorfeus-react.rb, where the component reducers were added
|
38
|
+
@store = ::Redux::Store.init!
|
39
|
+
`Opal.Isomorfeus.store = #@store`
|
40
|
+
end
|
41
|
+
|
42
|
+
def something_loading!
|
43
|
+
@something_loading = true
|
44
|
+
end
|
45
|
+
|
46
|
+
def something_loading?
|
47
|
+
res = @something_loading
|
48
|
+
@something_loading = false
|
49
|
+
res
|
50
|
+
end
|
51
|
+
|
52
|
+
def reset_something_loading
|
53
|
+
@something_loading = false
|
54
|
+
end
|
55
|
+
end
|
56
|
+
else # RUBY_ENGINE
|
57
|
+
class << self
|
58
|
+
attr_accessor :server_init_class_names
|
59
|
+
|
60
|
+
def execute_init_classes
|
61
|
+
server_init_class_names.each do |constant|
|
62
|
+
constant.constantize.send(:init)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def store_initialized
|
67
|
+
Thread.current[:@_isomorfeus_store_initialized]
|
68
|
+
end
|
69
|
+
|
70
|
+
def store
|
71
|
+
Thread.current[:@_isomorfeus_store]
|
72
|
+
end
|
73
|
+
|
74
|
+
def init_store
|
75
|
+
return if store_initialized
|
76
|
+
Thread.current[:@_isomorfeus_store_initialized] = true
|
77
|
+
force_init_store!
|
78
|
+
end
|
79
|
+
|
80
|
+
def force_init_store!
|
81
|
+
# at least one reducer must have been added at this stage
|
82
|
+
# this happened in isomorfeus-preact.rb, where the component reducers were added
|
83
|
+
Thread.current[:@_isomorfeus_store] = ::Redux::Store.init!
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
def something_loading!
|
88
|
+
Thread.current[:isomorfeus_something_loading] = true
|
89
|
+
end
|
90
|
+
|
91
|
+
def something_loading?
|
92
|
+
res = Thread.current[:isomorfeus_something_loading]
|
93
|
+
Thread.current[:isomorfeus_something_loading] = false
|
94
|
+
res
|
95
|
+
end
|
96
|
+
|
97
|
+
def reset_something_loading
|
98
|
+
Thread.current[:isomorfeus_something_loading] = false
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
server_init_class_names = []
|
103
|
+
end # RUBY_ENGINE
|
104
|
+
end
|
data/lib/local_store.rb
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
# backtick_javascript: true
|
2
|
-
|
3
|
-
class LocalStore
|
4
|
-
extend Isomorfeus::BrowserStoreApi
|
5
|
-
|
6
|
-
class << self
|
7
|
-
if RUBY_ENGINE == 'opal'
|
8
|
-
def [](key)
|
9
|
-
value = `Opal.global.localStorage.getItem(key)`
|
10
|
-
return nil if `value == null`
|
11
|
-
value
|
12
|
-
end
|
13
|
-
|
14
|
-
def []=(key, value)
|
15
|
-
`Opal.global.localStorage.setItem(key, value)`
|
16
|
-
notify_subscribers
|
17
|
-
value
|
18
|
-
end
|
19
|
-
|
20
|
-
def delete(key)
|
21
|
-
`Opal.global.localStorage.removeItem(key)`
|
22
|
-
notify_subscribers
|
23
|
-
nil
|
24
|
-
end
|
25
|
-
|
26
|
-
def clear
|
27
|
-
`Opal.global.localStorage.clear()`
|
28
|
-
notify_subscribers
|
29
|
-
nil
|
30
|
-
end
|
31
|
-
else
|
32
|
-
def [](key); end
|
33
|
-
def []=(key, value); end
|
34
|
-
def delete(key); end
|
35
|
-
def clear; end
|
36
|
-
end
|
37
|
-
alias get []
|
38
|
-
alias set []=
|
39
|
-
end
|
40
|
-
end
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
3
|
+
class LocalStore
|
4
|
+
extend Isomorfeus::BrowserStoreApi
|
5
|
+
|
6
|
+
class << self
|
7
|
+
if RUBY_ENGINE == 'opal'
|
8
|
+
def [](key)
|
9
|
+
value = `Opal.global.localStorage.getItem(key)`
|
10
|
+
return nil if `value == null`
|
11
|
+
value
|
12
|
+
end
|
13
|
+
|
14
|
+
def []=(key, value)
|
15
|
+
`Opal.global.localStorage.setItem(key, value)`
|
16
|
+
notify_subscribers
|
17
|
+
value
|
18
|
+
end
|
19
|
+
|
20
|
+
def delete(key)
|
21
|
+
`Opal.global.localStorage.removeItem(key)`
|
22
|
+
notify_subscribers
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
|
26
|
+
def clear
|
27
|
+
`Opal.global.localStorage.clear()`
|
28
|
+
notify_subscribers
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
else
|
32
|
+
def [](key); end
|
33
|
+
def []=(key, value); end
|
34
|
+
def delete(key); end
|
35
|
+
def clear; end
|
36
|
+
end
|
37
|
+
alias get []
|
38
|
+
alias set []=
|
39
|
+
end
|
40
|
+
end
|
data/lib/session_store.rb
CHANGED
@@ -1,41 +1,41 @@
|
|
1
|
-
# backtick_javascript: true
|
2
|
-
|
3
|
-
class SessionStore
|
4
|
-
extend Isomorfeus::BrowserStoreApi
|
5
|
-
|
6
|
-
class << self
|
7
|
-
if RUBY_ENGINE == 'opal'
|
8
|
-
def [](key)
|
9
|
-
# check store for value
|
10
|
-
value = `Opal.global.sessionStorage.getItem(key)`
|
11
|
-
return nil if `value == null`
|
12
|
-
value
|
13
|
-
end
|
14
|
-
|
15
|
-
def []=(key, value)
|
16
|
-
`Opal.global.sessionStorage.setItem(key, value)`
|
17
|
-
notify_subscribers
|
18
|
-
value
|
19
|
-
end
|
20
|
-
|
21
|
-
def delete(key)
|
22
|
-
`Opal.global.sessionStorage.removeItem(key)`
|
23
|
-
notify_subscribers
|
24
|
-
nil
|
25
|
-
end
|
26
|
-
|
27
|
-
def clear
|
28
|
-
`Opal.global.sessionStorage.clear()`
|
29
|
-
notify_subscribers
|
30
|
-
nil
|
31
|
-
end
|
32
|
-
else
|
33
|
-
def [](key); end
|
34
|
-
def []=(key, value); end
|
35
|
-
def delete(key); end
|
36
|
-
def clear; end
|
37
|
-
end
|
38
|
-
alias get []
|
39
|
-
alias set []=
|
40
|
-
end
|
41
|
-
end
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
3
|
+
class SessionStore
|
4
|
+
extend Isomorfeus::BrowserStoreApi
|
5
|
+
|
6
|
+
class << self
|
7
|
+
if RUBY_ENGINE == 'opal'
|
8
|
+
def [](key)
|
9
|
+
# check store for value
|
10
|
+
value = `Opal.global.sessionStorage.getItem(key)`
|
11
|
+
return nil if `value == null`
|
12
|
+
value
|
13
|
+
end
|
14
|
+
|
15
|
+
def []=(key, value)
|
16
|
+
`Opal.global.sessionStorage.setItem(key, value)`
|
17
|
+
notify_subscribers
|
18
|
+
value
|
19
|
+
end
|
20
|
+
|
21
|
+
def delete(key)
|
22
|
+
`Opal.global.sessionStorage.removeItem(key)`
|
23
|
+
notify_subscribers
|
24
|
+
nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def clear
|
28
|
+
`Opal.global.sessionStorage.clear()`
|
29
|
+
notify_subscribers
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
else
|
33
|
+
def [](key); end
|
34
|
+
def []=(key, value); end
|
35
|
+
def delete(key); end
|
36
|
+
def clear; end
|
37
|
+
end
|
38
|
+
alias get []
|
39
|
+
alias set []=
|
40
|
+
end
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-redux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 23.8.0.
|
4
|
+
version: 23.8.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 23.8.0.
|
33
|
+
version: 23.8.0.rc2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 23.8.0.
|
40
|
+
version: 23.8.0.rc2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: isomorfeus-puppetmaster
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|