actionstore 0.1.1 → 0.3.0

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: 2c675d4099278efecc835c8898f8817c6bdd5cd820f90524455e64cf3dbb6efe
4
- data.tar.gz: 3d8dd1b6295f294b4d7caa02fcbbae498d764d540125938b48425c3ca46b35a3
3
+ metadata.gz: 8a5099e39606b34e15e4a298ba73a6798c7d09bfd5118d40434e0bc6ed217d63
4
+ data.tar.gz: 062f6d85f3f781c30c3c950c2421bd80693e35c4c20fb7a76d143ad5bd1d2520
5
5
  SHA512:
6
- metadata.gz: bc67a5d2caa7a31b8c6c66cfe0f15dd3afd7a028acf74f7e268d4953faeebb3937ab7b6516c06b7096b868b4a4859f69305ba20e85b8633e81e49345a16d46ad
7
- data.tar.gz: cae2b6a42e66647ba6c3d736b7d6113e665541d599fdfaa0faf64c6399179e0acfe9d3ef3898d9d4512538ebc689e38965adbf31102e231891a8655ba6692d7a
6
+ metadata.gz: ce0944a422441bc62c5108850ecd23415a26e02b6211865de9730264ec0ebb8aa9c2abb2b24c84efde29f569a7dcff87fa72add19605458f05cddb07fa500aa8
7
+ data.tar.gz: 1a54c2f513d7fa7766b5dadcfba6f7705168848ecd622d2558e48a1a4a88a0cd7a2a81e80c7be66a1cd52ab15cf74ec5ab6186d325a74df0f70797fe184dee39
@@ -32,6 +32,25 @@ module Actionstore
32
32
  def push_update_into store_id, changes = {}
33
33
  Actionstore::Channel.broadcast_to self, store_id: Actionstore.store_id(store_id), action: 'update', changes: changes
34
34
  end
35
+
36
+ def push_update_by key, value, changes
37
+ Actionstore::Channel.broadcast_to self, action: 'update_by', key: key, value: value, changes: changes
38
+ end
39
+
40
+ def push_update_by_into store_id, key, value, changes
41
+ store_id = Actionstore.store_id(store_id)
42
+ Actionstore::Channel.broadcast_to self, store_id: store_id, action: 'update_by', key: key, value: value, changes: changes
43
+ end
44
+
45
+ def push_append value
46
+ Actionstore::Channel.broadcast_to self, action: 'append', value: value
47
+ end
48
+
49
+ def push_append_into store_id, value
50
+ store_id = Actionstore.store_id(store_id)
51
+ Actionstore::Channel.broadcast_to self, store_id: store_id, action: 'append', value: value
52
+ end
53
+
35
54
 
36
55
  def push_event event, data = nil
37
56
  Actionstore::Channel.broadcast_to self, action: event, data: data
@@ -8,16 +8,35 @@ module Actionstore
8
8
  end
9
9
 
10
10
  def push_update changes
11
- push_update_into nil, changes
11
+ transmit({action: 'update', changes: changes})
12
12
  end
13
13
 
14
14
  def push_update_into store_id, changes
15
- store_id = ActionStore.store_id(store_id)
15
+ store_id = Actionstore.store_id(store_id)
16
16
  transmit({store_id: store_id, action: 'update', changes: changes})
17
17
  end
18
+
19
+ def push_update_by key, value, changes
20
+ transmit({action: 'update_by', key: key, value: value, changes: changes})
21
+ end
22
+
23
+ def push_update_by_into store_id, key, value, changes
24
+ store_id = Actionstore.store_id(store_id)
25
+ transmit({store_id: store_id, action: 'update_by', key: key, value: value, changes: changes})
26
+ end
27
+
28
+ def push_append value
29
+ transmit({action: 'append', value: value})
30
+ end
31
+
32
+ def push_append_into store_id, value
33
+ store_id = Actionstore.store_id(store_id)
34
+ transmit({store_id: store_id, action: 'append', value: value})
35
+ end
36
+
18
37
 
19
38
  def perform_action data
20
- @subject.send "perform_#{data['action']}", current_user, *data['args']
39
+ @subject.send "perform_#{data['action']}", self, *data['args']
21
40
  end
22
41
 
23
42
  def unsubscribed
@@ -1,3 +1,3 @@
1
1
  module Actionstore
2
- VERSION = "0.1.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Buhrmester
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-02 00:00:00.000000000 Z
11
+ date: 2022-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.3.7
64
+ rubygems_version: 3.2.22
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Push data into Svelte stores from Rails