Skip to content

Commit

Permalink
Deprecate model fn; fix type for fn args
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbeck committed Jul 18, 2024
1 parent d8fbfcd commit 2d2de09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Model/fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var util = require('../util');

class NamedFns { }

type StartFnParam = string | number | boolean | null | undefined | ReadonlyDeep<unknown>;
type StartFnParam = unknown;

type ModelFn<Ins extends unknown[], Out> =
(...inputs: Ins) => Out |
Expand Down Expand Up @@ -90,6 +90,10 @@ declare module './Model' {
* It's not recommended to use this in most cases. Instead, to share reactive functions,
* have the components import a shared function to pass to `model.start`.
*
* @deprecated The use of named funcitons is deprecated. With typescript and modern tooling
* you get better type information, code navigation, and refactoring support that is lost
* when using named functions.
*
* @param name name of the function to define
* @param fn either a reactive function that accepts inputs and returns output, or
* a `{ get: Function; set: Function }` object defining a two-way reactive function
Expand Down

0 comments on commit 2d2de09

Please sign in to comment.