Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Support not needing to pass in a noop function to call functions in the opt chain #33

Open
lucasdellabella opened this issue Apr 30, 2019 · 0 comments

Comments

@lucasdellabella
Copy link

lucasdellabella commented Apr 30, 2019

Feature request:

Currently to invoke a function in the chain I need to do something like this

const a: any[] | null = ...
oc(a).push(() => {})('my value')

So I don't have to pass noop functions in that make my code nasty could we do something like
oc(a).push._('my value')
that would invoke the function if it exists, if the chain is undefined it just returns undefined? I don't mind submitting a PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant