view_component_reflex 3.1.14.pre4 → 3.1.14.pre5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5ccc3bdc0b0a80f7be53b17bc99a7edd35acf72b78a45229b8be6e64bca7e19
4
- data.tar.gz: 31e7bd34a88647a6c35433fe4e8bd2ac4f8c283d050f4bab272a08ca47f4550b
3
+ metadata.gz: 5a7111c46b8da709628cef557dee26756076264734e18975bdcc39735f3d7171
4
+ data.tar.gz: c9d10a5c3928d777c76248c22eb2c9bcc33ddd1a7bbf0caa60e60321022b2dc8
5
5
  SHA512:
6
- metadata.gz: 5966a7aaebf72045ce3316c4e4ac24c0d0bff372df85f9a5968e602608c4b4f65c92ae07bbf70cb76141b6337712bf572b807c09e6d09208fead39bdc7b79d37
7
- data.tar.gz: cf07e301eb404f8598e6ac7f12108fb7e5429cfd4a32e85ed159c762dc330a4992117134fc9175f01a73dc5ca33a3078177e6d3bb986dd26b4efdccc8971f985
6
+ metadata.gz: 7bb30effed81a878acedd50102e7c3db49777cb3d4c9d287245a940fef762751cafbdba5a2a1500ed24c6cc7d25e969fb44e9fcc1a3feb6d440ab00d3697baa3
7
+ data.tar.gz: ab91076e03ad19c59c148ad59e7161e72588620e572fc44d0693c64d7d1bfcf72b870c8a2b31568cbf46a88fcce8d12e025a5c0644976ce6508d7422640e2a2b
@@ -7,7 +7,14 @@ module ViewComponentReflex
7
7
  def init_stimulus_reflex
8
8
  factory = ViewComponentReflex::ReflexFactory.new(self)
9
9
  @stimulus_reflex ||= factory.reflex
10
- wire_up_callbacks if factory.new?
10
+
11
+ # Always wire up new callbacks in development
12
+ if Rails.env.development?
13
+ reset_callbacks
14
+ wire_up_callbacks
15
+ elsif factory.new? # only wire up callbacks in production if they haven't been wired up yet
16
+ wire_up_callbacks
17
+ end
11
18
  end
12
19
 
13
20
  def queue_callback(key, args, blk)
@@ -40,6 +47,11 @@ module ViewComponentReflex
40
47
  queue_callback(:around, args, blk)
41
48
  end
42
49
 
50
+ def reset_callbacks
51
+ # SR uses :process as the underlying callback key
52
+ @stimulus_reflex.reset_callbacks(:process)
53
+ end
54
+
43
55
  def wire_up_callbacks
44
56
  register_callbacks(:before)
45
57
  register_callbacks(:after)
@@ -1,3 +1,3 @@
1
1
  module ViewComponentReflex
2
- VERSION = '3.1.14.pre4'
2
+ VERSION = '3.1.14.pre5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.14.pre4
4
+ version: 3.1.14.pre5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua LeBlanc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-11 00:00:00.000000000 Z
11
+ date: 2021-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails