aweary / aweary/react-copy-write

[rcw] Proposal to add a 2nd optional parameter to `mutate`

Open
#48 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.8k
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Just to continue our discussion around adding a 2nd optional parameter to `mutate` to pass additional information/options that might be needed by different 'plugins' (eg. devtools). I'm proposing the following (basically allow each plugin to reserve one slot in the option object):

```
type Option = {
// ... core options
// plugin options
pluginA?: {
isDevMode: boolean,
},
pluginB?: {
mutationName: string,
},
};

// Could also use Symbol to reserve the slot when flow supports it
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.