Hyperapp Fx Versions Save

Effects for use with Hyperapp

2.0.0-beta.2

3 years ago

What's new?

GetCurrentPosition effect and WatchPosition sub for geolocation.

New open and close actions added to WebSocketListen.

Thanks @shish!

2.0.0-alpha.7

5 years ago

What's new?

Say hello to the newest in the FX family called Dispatch.

2.0.0-alpha.6

5 years ago

What's new?

Random learned some new tricks. It can now handle generating random integers:

Random({
  min: 1,
  max: 6,
  int: true,
  action: (state, roll) => {
    // roll will be an int from 1-6
  }
})

booleans:

Random({
  bool: true,
  action: (state, value) => {
    // value will be true or false
  }
})

and arrays of values:

Random({
  values: [
    {},
    { min: 2, max: 5 },
    { int: true, min: 1, max: 3 },
    { bool: true }
  ],
  action: (state, values) => {
    // values[0] will be a floating point number in the default range of [0, 1)
    // values[1] will be a floating point number in the range [2, 5)
    // values[2] will be one of the following integers: [1, 2, 3]
    // values[3] will be true or false
  }
})

2.0.0-alpha.5

5 years ago

Breaking changes

Removed BatchFx since Hyperapp v2 supports parallel FX.

Here's how to update your code:

// Before
import { BatchFx } from "hyperapp-fx"

const BatchedAction = state => [
  state,
  BatchFx(
    Effect1,
    Effect2,
    // ...
  )
]

// After
const BatchedAction = state => [
  state,
  Effect1,
  Effect2,
  // ...
]

2.0.0-alpha.4

5 years ago

Breaking changes

2.0.0-alpha.2

5 years ago

What's new?

Improved documentation.

2.0.0-alpha.3

5 years ago

What's new?

Special thanks to @rmc for the implementations 🙏

0.7.0

6 years ago

Breaking changes

  • window.fx => window.hyperappFx

What's new?

Support for Hyperapp 1.2.0 including lazy components/subviews in your view when using @hyperapp/fx.

0.6.1

6 years ago

What's new?

Say hello to two new fx for debounce and throttle! See the docs for more details, but here are a couple of brief examples:

const actions = {
  waitForLastInput: input => debounce(
    500,
    "search",
    { query: input }
  ),
  search: data => {
    /*
      This action will run after waiting
      for 500ms since the last call
    */
  }
}
const actions = {
  doExpensiveAction: param => throttle(
    500,
    "calculate",
    { foo: param }
  ),
  calculate: data => {
    // This action will only run once per 500ms
  }
}

Thanks @rmc for #27!

Bug fixes

Empty arrays are now valid no-op fx instead of throwing an error. This is useful when using fxIf if all of the conditionals are falsy. Fixed in #28.

0.6.0

6 years ago

Say hello to the newly-renamed @hyperapp/fx and install accordingly:

npm rm hyperapp-effects
npm i @hyperapp/fx

Or in your package.json file:

"dependencies": {
  "hyperapp": "^1.1.2",
- "hyperapp-effects": "^0.5.2"
+ "@hyperapp/fx": "^0.6.0"
},

Some renovations were made along with the move, please pardon our dust.

  • window.effects => window.fx
  • withEffects => withFx
  • effectsIf => fxIf
- import { withEffects } from "hyperapp-effects"
+ import { withFx } from "@hyperapp/fx"

- effectsIf([
+ fxIf([
  [condition, action("ifCondition")],
  // ...
])

- withEffects(app)(state, actions, view, ...)
+ withFx(app)(state, actions, view, ...)