Skip to content

Formalizing a <action_fns> object #612

@yjunechoe

Description

@yjunechoe

As part of the action levels overhaul (#611), I wonder whether we could introduce a lightweight action_fns() object, such that:

action_levels(
  warn = 1,
  fns = list(warn = ~stock_warning(x = x))
)

Becomes:

action_levels(
  warn = 1,
  fns = action_fns(warn = ~stock_warning(x = x))
)

The most obvious benefit is it'd streamline the deprecation process both for the internal code (fns can just check whether it's receiving a <action_fns> object) and for hand-holding users (we can just direct them to use fns = action_fns() instead, which will host the relevant documentation).

Beyond that, I think having a function is nice because it obviates the need to checks for "list must be named", "list names must be one of xyz", etc. :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions