@yaasl/devtools 0.11.0-alpha.0 → 0.11.0-alpha.2

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.
@@ -15,6 +15,7 @@ const createLogger = (text) => ({ atom, value, options }) => {
15
15
  * @returns The effect to be used on atoms.
16
16
  **/
17
17
  exports.logger = (0, core_1.createEffect)({
18
+ sort: "post",
18
19
  init: createLogger("Initialize"),
19
20
  didInit: createLogger("Finished initialization"),
20
21
  set: createLogger("Set value"),
@@ -35,6 +35,15 @@ exports.reduxDevtools = (0, core_1.createEffect)(({ atom, options = {} }) => {
35
35
  return {};
36
36
  (0, exports.connectAtom)(connection, atom);
37
37
  return {
38
+ sort: "post",
39
+ init: ({ value }) => {
40
+ cache_1.cache.setAtomValue(atom, value);
41
+ connection.send({ type: `INIT/${atom.name}` }, cache_1.cache.getStore());
42
+ },
43
+ didInit: ({ value }) => {
44
+ cache_1.cache.setAtomValue(atom, value);
45
+ connection.send({ type: `DID_INIT/${atom.name}` }, cache_1.cache.getStore());
46
+ },
38
47
  set: ({ atom, value }) => {
39
48
  isInitPhase = false;
40
49
  if (updates_1.updates.isPaused())
@@ -12,6 +12,7 @@ const createLogger = (text) => ({ atom, value, options }) => {
12
12
  * @returns The effect to be used on atoms.
13
13
  **/
14
14
  export const logger = createEffect({
15
+ sort: "post",
15
16
  init: createLogger("Initialize"),
16
17
  didInit: createLogger("Finished initialization"),
17
18
  set: createLogger("Set value"),
@@ -31,6 +31,15 @@ export const reduxDevtools = createEffect(({ atom, options = {} }) => {
31
31
  return {};
32
32
  connectAtom(connection, atom);
33
33
  return {
34
+ sort: "post",
35
+ init: ({ value }) => {
36
+ cache.setAtomValue(atom, value);
37
+ connection.send({ type: `INIT/${atom.name}` }, cache.getStore());
38
+ },
39
+ didInit: ({ value }) => {
40
+ cache.setAtomValue(atom, value);
41
+ connection.send({ type: `DID_INIT/${atom.name}` }, cache.getStore());
42
+ },
34
43
  set: ({ atom, value }) => {
35
44
  isInitPhase = false;
36
45
  if (updates.isPaused())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaasl/devtools",
3
- "version": "0.11.0-alpha.0",
3
+ "version": "0.11.0-alpha.2",
4
4
  "description": "yaasl debugging tools (e.g. redux-devtools-extension middleware)",
5
5
  "author": "PrettyCoffee",
6
6
  "license": "MIT",
@@ -15,18 +15,20 @@
15
15
  "bugs": {
16
16
  "url": "https://github.com/PrettyCoffee/yaasl/issues"
17
17
  },
18
+ "sideEffects": false,
18
19
  "main": "./dist/cjs/index.js",
20
+ "module": "./dist/esm/index.js",
19
21
  "types": "./dist/@types/index.d.ts",
20
22
  "exports": {
21
23
  "types": "./dist/@types/index.d.ts",
22
- "import": "./dist/mjs/index.js",
23
- "require": "./dist/cjs/index.js"
24
+ "require": "./dist/cjs/index.js",
25
+ "default": "./dist/esm/index.js"
24
26
  },
25
27
  "scripts": {
26
28
  "build": "run-s clean compile",
27
29
  "clean": "rimraf ./dist",
28
- "compile": "run-p compile:mjs compile:cjs compile:types",
29
- "compile:mjs": "tsc -p ./tsconfig.node.json --outDir ./dist/mjs -m esnext -t esnext",
30
+ "compile": "run-p compile:esm compile:cjs compile:types",
31
+ "compile:esm": "tsc -p ./tsconfig.node.json --outDir ./dist/esm -m esnext -t esnext",
30
32
  "compile:cjs": "tsc -p ./tsconfig.node.json --outDir ./dist/cjs -m commonjs -t es2015",
31
33
  "compile:types": "tsc -p ./tsconfig.node.json --outDir ./dist/@types --declaration --emitDeclarationOnly",
32
34
  "test": "vitest run",
@@ -36,8 +38,8 @@
36
38
  "validate": "run-s lint test build"
37
39
  },
38
40
  "dependencies": {
39
- "@yaasl/core": "0.11.0-alpha.0",
40
- "@yaasl/utils": "0.11.0-alpha.0"
41
+ "@yaasl/core": "0.11.0-alpha.2",
42
+ "@yaasl/utils": "0.11.0-alpha.2"
41
43
  },
42
44
  "eslintConfig": {
43
45
  "extends": [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes