April 2018
Beginner to intermediate
406 pages
9h 33m
English
import statements can work in two ways; either through working with default imports or named imports. Looking at the example we wrote for the first line:
import { Socket } from 'phoenix';
This is an example of a named import. Anything we put in brackets will be a named import. In this case, we're looking for something that was exported from the Phoenix library as "socket". This is usually the case when there are multiple exports in a single file or library. The corresponding export might look something like this:
// This is not the actual code, just an example of how this could looklet Socket = {};export { Socket };
This is the way that we're going to be able to work with other libraries and how we're going to be able ...