-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from kireevmp/feat/add-transform-legacy-domain…
…-methods-option Add an option to disable transforming `Domain` methods
- Loading branch information
Showing
7 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"effector-swc-plugin": minor | ||
--- | ||
|
||
Add a new `transformLegacyDomainMethods` option to configure transforming `Domain`'s unit creators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"addNames": true, | ||
"addLoc": true, | ||
"transformLegacyDomainMethods": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { createDomain } from "effector"; | ||
import { importedDomain } from "./local-file"; | ||
|
||
const created = createDomain("created"); | ||
// --- event --- | ||
const event = created.createEvent(); | ||
const eventShort = created.event(); | ||
const eventImported = importedDomain.event("name"); | ||
// --- effect --- | ||
const effect = created.createEffect(() => 0); | ||
const effectShort = created.effect({ handler: () => 0 }); | ||
const effectImported = importedDomain.effect(() => 0, { name: "name" }); | ||
// --- store --- | ||
const store = created.createStore(0); | ||
const storeShort = created.store(0, { name: "short" }); | ||
const storeImported = importedDomain.store("value"); | ||
// --- domain --- | ||
const domain = created.createDomain(); | ||
const domainShort = created.domain("name"); | ||
const domainImported = importedDomain.domain(); | ||
// --- usage as argument --- | ||
createDomain({ name: "second", domain: created }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { createDomain } from "effector"; | ||
import { importedDomain } from "./local-file"; | ||
const created = createDomain("created", { | ||
sid: "bm4rhtf8", | ||
name: "created", | ||
loc: { | ||
file: "input.js", | ||
line: 4, | ||
column: 16 | ||
} | ||
}); | ||
// --- event --- | ||
const event = created.createEvent(); | ||
const eventShort = created.event(); | ||
const eventImported = importedDomain.event("name"); | ||
// --- effect --- | ||
const effect = created.createEffect(()=>0); | ||
const effectShort = created.effect({ | ||
handler: ()=>0 | ||
}); | ||
const effectImported = importedDomain.effect(()=>0, { | ||
name: "name" | ||
}); | ||
// --- store --- | ||
const store = created.createStore(0); | ||
const storeShort = created.store(0, { | ||
name: "short" | ||
}); | ||
const storeImported = importedDomain.store("value"); | ||
// --- domain --- | ||
const domain = created.createDomain(); | ||
const domainShort = created.domain("name"); | ||
const domainImported = importedDomain.domain(); | ||
// --- usage as argument --- | ||
createDomain({ | ||
name: "second", | ||
domain: created | ||
}, { | ||
sid: "29ysq6c8", | ||
loc: { | ||
file: "input.js", | ||
line: 22, | ||
column: 0 | ||
} | ||
}); |