Skip to content

Commit

Permalink
Merge pull request #312 from derbyjs/deprecate-model-fn
Browse files Browse the repository at this point in the history
Deprecate model fn; fix type for fn args
  • Loading branch information
craigbeck committed Jul 19, 2024
2 parents b4992ed + aaad8dc commit 566091d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 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,9 @@ 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 functions is deprecated. Instead, to share a reactive function,
* you should export it and then require/import it into each file that needs to use it.
*
* @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 566091d

Please sign in to comment.