-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthew Green
committed
Apr 17, 2016
1 parent
11b303d
commit 521e50b
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
521e50b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use lodash and import just the methods you need
521e50b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdalton - 👍 lodash ...
well here is the underscore implementation: https://github.com/matt4446/WhatsMyScore2-NativeScript/blob/master/app/pipes/orderBy.ts
the import is not sufficient as there are no typescript files in the node_module ... or am I missing something cool about TypeScript <-> JS?
I've added the typings file:
typings install lodash
, which will globally give me Intellisense for_
(for lodash) which I can re-do the underscore version, but I'm curious how to use justimport {orderBy} from 'lodash/orderBy'
I could just use:
var orderBy = require("lodash/orderBy")
but that will only give me type definition ofany
, which I would rather avoid and have typed version.521e50b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big user of TypeScript so not much help on that front.
521e50b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdalton ok, no problem thanks for the suggestion. I'll have a play at some point (and I'll look at the performance differences). It looks like an easy conversion but I want to get more of the pages done for the moment. I'll come back to it.