-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor for org/repo name change * lots of effects => fx refactoring * update readme to be more in line with the rest of hyperapp org add new quote fetching example
- Loading branch information
Showing
12 changed files
with
205 additions
and
174 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
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
export function fxIf(fxSpecs) { | ||
return fxSpecs | ||
.filter(function(fxSpec) { | ||
// first element is the conditional | ||
return fxSpec[0] | ||
}) | ||
.map(function(fxSpec) { | ||
// second element is the effect to include | ||
return fxSpec[1] | ||
}) | ||
} |
File renamed without changes.
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { default as withEffects } from "./withEffects" | ||
export * from "./effectCreators" | ||
export { default as effectsIf } from "./effectsIf" | ||
export { withFx } from "./withFx" | ||
export * from "./fxCreators" | ||
export { fxIf } from "./fxIf" |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { action, effectsIf } from "../dist/effects" | ||
import { action, fxIf } from "../src" | ||
|
||
describe("effectsIf", () => { | ||
describe("fxIf", () => { | ||
it("should filter out effects with truthy conditionals", () => | ||
expect( | ||
effectsIf([[true, action("include")], [false, action("exclude")]]) | ||
fxIf([[true, action("include")], [false, action("exclude")]]) | ||
).toEqual([action("include")])) | ||
}) |
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,8 @@ | ||
import { action, fxIf } from "../src" | ||
|
||
describe("fxIf", () => { | ||
it("should filter out effects with truthy conditionals", () => | ||
expect( | ||
fxIf([[true, action("include")], [false, action("exclude")]]) | ||
).toEqual([action("include")])) | ||
}) |
Oops, something went wrong.