@wordpress/core-data 7.43.2-next.v.202604091042.0 → 7.44.1-next.v.202604201441.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/build/hooks/use-entity-prop.cjs +1 -1
  3. package/build/hooks/use-entity-prop.cjs.map +2 -2
  4. package/build/queried-data/reducer.cjs +5 -4
  5. package/build/queried-data/reducer.cjs.map +2 -2
  6. package/build/utils/crdt-blocks.cjs +54 -26
  7. package/build/utils/crdt-blocks.cjs.map +2 -2
  8. package/build/utils/crdt-selection.cjs.map +2 -2
  9. package/build/utils/crdt.cjs.map +2 -2
  10. package/build/utils/index.cjs +0 -3
  11. package/build/utils/index.cjs.map +2 -2
  12. package/build-module/hooks/use-entity-prop.mjs +1 -1
  13. package/build-module/hooks/use-entity-prop.mjs.map +2 -2
  14. package/build-module/queried-data/reducer.mjs +7 -11
  15. package/build-module/queried-data/reducer.mjs.map +2 -2
  16. package/build-module/utils/crdt-blocks.mjs +54 -26
  17. package/build-module/utils/crdt-blocks.mjs.map +2 -2
  18. package/build-module/utils/crdt-selection.mjs.map +2 -2
  19. package/build-module/utils/crdt.mjs.map +2 -2
  20. package/build-module/utils/index.mjs +12 -14
  21. package/build-module/utils/index.mjs.map +2 -2
  22. package/build-types/queried-data/reducer.d.ts.map +1 -1
  23. package/build-types/utils/crdt-blocks.d.ts.map +1 -1
  24. package/build-types/utils/crdt-selection.d.ts.map +1 -1
  25. package/build-types/utils/crdt.d.ts.map +1 -1
  26. package/build-types/utils/index.d.ts +0 -1
  27. package/package.json +18 -18
  28. package/src/hooks/use-entity-prop.js +1 -1
  29. package/src/queried-data/reducer.js +9 -12
  30. package/src/queried-data/test/reducer.js +7 -0
  31. package/src/utils/crdt-blocks.ts +103 -36
  32. package/src/utils/crdt-selection.ts +0 -1
  33. package/src/utils/crdt.ts +0 -1
  34. package/src/utils/index.js +0 -1
  35. package/src/utils/test/crdt-blocks.ts +544 -1
  36. package/build/utils/on-sub-key.cjs +0 -46
  37. package/build/utils/on-sub-key.cjs.map +0 -7
  38. package/build-module/utils/on-sub-key.mjs +0 -21
  39. package/build-module/utils/on-sub-key.mjs.map +0 -7
  40. package/build-types/utils/on-sub-key.d.ts +0 -4
  41. package/build-types/utils/on-sub-key.d.ts.map +0 -1
  42. package/src/utils/on-sub-key.js +0 -35
  43. package/src/utils/test/on-sub-key.js +0 -46
@@ -1,46 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import deepFreeze from 'deep-freeze';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import onSubKey from '../on-sub-key';
10
-
11
- describe( 'onSubKey', () => {
12
- function createEnhancedReducer( actionProperty ) {
13
- const enhanceReducer = onSubKey( actionProperty );
14
- return enhanceReducer(
15
- ( state, action ) => 'Called by ' + action.caller
16
- );
17
- }
18
-
19
- it( 'should default to an empty object', () => {
20
- const reducer = createEnhancedReducer( 'caller' );
21
- const nextState = reducer( undefined, { type: '@@INIT' } );
22
-
23
- expect( nextState ).toEqual( {} );
24
- } );
25
-
26
- it( 'should ignore actions where property not present', () => {
27
- const state = deepFreeze( {} );
28
- const reducer = createEnhancedReducer( 'caller' );
29
- const nextState = reducer( state, { type: 'DO_FOO' } );
30
-
31
- expect( nextState ).toBe( state );
32
- } );
33
-
34
- it( 'should key by action property', () => {
35
- const reducer = createEnhancedReducer( 'caller' );
36
-
37
- let state = deepFreeze( {} );
38
- state = reducer( state, { type: 'DO_FOO', caller: 1 } );
39
- state = reducer( state, { type: 'DO_FOO', caller: 2 } );
40
-
41
- expect( state ).toEqual( {
42
- 1: 'Called by 1',
43
- 2: 'Called by 2',
44
- } );
45
- } );
46
- } );